TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Java 8 lambda syntax decided - same as C# and Scala

169 pointsby tomeastover 13 years ago

11 comments

zmmmmmover 13 years ago
Nice to see pragmatism playing a role here. A big problem with Java has always been the "design by committee" nature of it where we end up with some theoretical best case that satisfies everyone's egos but turns out to utterly suck when used in practice.<p>From another point of view ... it's a shame we needed so many years to come up with "let's do it like C#".
评论 #2976960 未加载
foskover 13 years ago
Finally a decision was made. The decisional process is too slow, this is why Java in 2011 still misses those features that languages like C# already support since years.
thurnover 13 years ago
Excellent to have this finally resolved. I'm sad to not see something a little closer to the ruby block syntax like in some of the early proposals, though. Special syntax for lambdas as the last argument to a function lets you write very readable code for a host of useful cases.
评论 #2977726 未加载
shawndumasover 13 years ago
"Mistakes will be made, but that's good because it means decisions are being made." -- Steve Jobs
评论 #2976317 未加载
jinushaunover 13 years ago
Good. The lambda syntax in C# rocks and is a natural fit for Java considering the origin of C#.
评论 #2976578 未加载
BDFL_Xenuover 13 years ago
I see that the proposed lambda expressions can omit type annotations on the parameters. Does that mean that Java 8 will have at least some limited form of type inference?
评论 #2976354 未加载
calebmpetersonover 13 years ago
try { // for a really long time } finally { // made a decision }
评论 #2976536 未加载
评论 #2976598 未加载
评论 #2976445 未加载
MatthewPhillipsover 13 years ago
Lambdas are a lot of fun on C#.<p>new Thread( =&#62; { doStuff(); }).Start();
评论 #2976515 未加载
评论 #2976344 未加载
zokierover 13 years ago
Any details on variable capturing from outer scope? The same as C# (apparently capture all variables?)?
评论 #2978070 未加载
评论 #2976708 未加载
mwshermanover 13 years ago
OP mentions that there were other ideas in the running. Anyone know what they were?
Rickasaurusover 13 years ago
Groupthink: I think we should have a vote on if we're going to vote on when we're going to set a deadline for deciding on lambda syntax.