• 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
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

When to avoid functional programming?

 
Bartender
Posts: 210
14
Mac OS X IntelliJ IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When should we not consider using lambdas and streams while writing new code or refactoring?
 
Author
Posts: 135
10
  • Likes 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A few situations:

The code has a lot of unavoidable side-effects that can't really be pushed to outside the functional pipelines.
The code would turn complex due to excessive exception handling and loose clarity or cohesiveness.

It is a good quality to be willing to evaluate, by way of prototyping, if imperative or functional style is a better choice for a particular problem on hand.
I often say that we're not in a competition where we are required to program in a particular style. We should be willing to pick what makes sense for a given situation.
 
Ranch Hand
Posts: 885
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Venkat,
This sounds like something we'll get better at as we get more experience with using Lambdas and the FP style of coding.
 
Venkat Subramaniam
Author
Posts: 135
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I agree, Burk, with experience and willingness to shift between the paradigms as needed helps.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic