5 ms·
> While the language is nice, there isn't a lot you can do with it in terms of productive development that you can't at least approximate in Java There is no s
by lordlicorice 15y ago
> While the language is nice, there isn't a lot you can do with it in terms of productive development that you can't at least approximate in Java
There is no substitute for lambdas :)
- wolfgke 15y agoLuckily C# supports them: http://msdn.microsoft.com/en-us/library/bb397687.aspx http://msdn.microsoft.com/en-us/library/bb397687.aspx
- aaronblohowiak 15y agoyour parent is suggesting that java does not have a substitute for lambdas.
- spacemanaki 15y agoWhich isn't true anyway, since anonymous inner classes are just very verbose and awkward lambdas. (I'm a Java hater but I'm also a horrible pedant)
- djacobs 15y agoTrue. Then again, what's the practical point of lambdas that aren't concisely expressed?
- spacemanaki 15y agoThere are plenty of practical uses: http://code.google.com/p/guava-libraries/wiki/FunctionalExplained http://code.google.com/p/guava-libraries/wiki/FunctionalExpl... Note that the Guava lib specifically points out how ugly this is. I prefer Clojure.
- baddox 15y agoWhat's the decision procedure for whether a certain expression is "concise?"
- batista 15y agoHorrible as in "no good" pedant? Because, no "anonymous inner classes" are no lambdas. They are, well, classes kludgily used to mimic a lambda proper.
- lubutu 15y agoWhat it is to be 'a lambda' isn't particularly well-defined. If we define it to mean an anonymous closure then Java certainly has them — so long as its free variables are final (it closes over references). On the other hand, if we define it as the operator which creates anonymous closures, then Java doesn't, because you have to actually build the closure by hand. Since the former have a proper name (closures) and the latter doesn't, I'd be inclined to call only the operator a 'lambda'. But since you can at least 'approximate' closures in Java (with anonymous inner classes), I think it's fair to say that they are "very verbose and awkward lambdas", to some definition of lambda.
- spacemanaki 15y agolordlicorice (the ggp of my post) suggested that there is "no substitute for lambdas" and I was intending to correct that. Anonymous inner classes are definitely a substitute.