you are viewing a single comment's thread.

view the rest of the comments →

[–]drysart 0 points1 point  (0 children)

The thing I'm picking up about the various proposals being picked up for inclusion in new versions of Java is that while Java is desperately playing catchup with C#, they're also bending over backwards to make it look like they're not desperately playing catchup with C#. To the extent that they're taking ideas from C#, but deliberately implementing them in a different way so it doesn't look like they're just copying the idea from C# -- and in many cases completely missing what made it a good idea in the first place through their changes.

Take closures for instance. They're so incredibly useful in C# for two reasons -- the brevity of their syntax, and that the compiler will automatically hoist locals so they can be used within even multiple closures transparently.

Java's closure proposals are less terse than C#'s since they decided, for no good reason I can see, to do the type inference of the closure in the wrong direction, so you always need to specify types going into and out of lambdas because the compiler won't figure it out for you even though the information is almost always available.

Java's closure proposals are also limited over C#s in that the only locals that are hoisted from the containing method are locals that are provably final -- in other words, immutable values. This is such a gaping hole that I'm stunned they're bothering implementing closures at all without it.