• 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
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

Mastering Lamdas - Why ?

 
Ranch Hand
Posts: 446
2
  • 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
 
Marshal
Posts: 67387
173
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: 10777
71
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
    Bookmark Topic Watch Topic
  • New Topic