• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Mastering Lamdas - Why ?

 
Ranch Hand
Posts: 390
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
Ever since it came out as a feature of Java8 ,I've been wondering why or how I would use Lambda expressions.
If it is just a matter of it being syntactically shorter why not use another Java compiled language with leaner syntax like Groovy or Scala?

Thanks,
Paul
 
Sheriff
Posts: 67269
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why learn a whole new language when learning a new notation for Java will take 1/10000th of the time?

 
Author
Posts: 20
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul

This seems to be two questions really: first, why would you want to use lambdas?; second, if you did find a use for them, why not switch to a different language that already has them? For the first, I'd recommend reading the book, which gives a lot of examples of how code using the Java Collections Framework and other APIs (especially new ones that will be designed with lambdas in mind) will be more concise, more readable, and more maintainable than its non-lambda equivalent. For the second, I agree with Bear: lambdas are not so wonderful and all-important that you would choose a language solely on the basis of its lambda features, especially if you were already heavily invested in Java.

Regards
Maurice
 
Bartender
Posts: 10759
68
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

paul nisset wrote:Ever since it came out as a feature of Java8 ,I've been wondering why or how I would use Lambda expressions.


Have a look at this. Best explanation I've seen for Lambdas bar none - and from a guy with only 2 posts!

it certainly makes me want to look at them some more. I love WhatNotHow stuff.

Winston
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!