This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Is there any class of problem you found is not a good candidate for lambda usage?  RSS feed

 
Ranch Hand
Posts: 239
12
Eclipse IDE IntelliJ IDE Java Scala Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since they are the hot new thing, it feels like everyone's talking about lambdas all the time. It's almost as if lambdas can be used to solve any problem. In writing Java 8 Lambdas: Pragmatic Functional Programming, did you find any areas where lambdas are bluntly the wrong tool for the job? What were they? Why do lambdas fail in these areas?
 
Author
Greenhorn
Posts: 22
7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Scott Shipp wrote:Since they are the hot new thing, it feels like everyone's talking about lambdas all the time. It's almost as if lambdas can be used to solve any problem. In writing Java 8 Lambdas: Pragmatic Functional Programming, did you find any areas where lambdas are bluntly the wrong tool for the job? What were they? Why do lambdas fail in these areas?



Hi Scott,

Thanks for the question. I won't say that there's a clear-cut line where lambdas are right and where they are wrong. Its more like there's a spectrum where they are best suited at one end and worst suited for use at the other end. Lambdas are best suited to situations where you want to write short, pure, simple methods and pass them around into other code. The further away from that ideal you get the more I would choose not to use them. So the larger the method, the more it mutates state and the more complex the logic, the better off you are using regular methods.

regards,

Richard
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!