• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Mastering Lamdas - Why ?

 
Ranch Hand
Posts: 572
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 67745
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic