Effectively final

Tim Fox timvolpe at gmail.com
Mon Aug 15 14:38:41 PDT 2011

On 15/08/2011 22:14, Brian Goetz wrote:
>> So I think it's better to disappoint some people and educate everyone to
>> use reduce:
>> int sum = parallelArray.reduce( 0, #{ element, sum ->   sum + element });
> Or, more likely:
>     int sum = collection.reduce(0, Reducers.INT_SUM);
> Remi has it right here.  You can say "all these languages let you do X
> with closures", but all of those idioms have their roots in a 1950s
> programming model where parallelism was science fiction.
There are other ways of scaling your program over multiple cores without 
letting your objects be executed concurrently by more than one thread. 
In some of these models closures that mutate local vars make a lot of sense.

It's all very well saying these programming languages are from the 50s. 
But these "50s" programming languages, like Ruby and JavaScript are 
slowly and surely taking away marketshare from Java with their ancient 
and outdated principles.

It also looks like they're going to get more and more popular on the JVM 
too (see the recent rennaissance in JVM langs... ).
>   Yes, it took
> Java a while to get closures, but adopting a 1950s-era view of closures
> just because we're still catching up is "not the modernization you are
> looking for."


More information about the lambda-dev mailing list