Win a copy of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 this week in the Programmer Certification 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:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Are developers currently using streams and functional programming in Java projects?

 
Ranch Hand
Posts: 77
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys. This time I wanted to ask you about if currently developers are using most of the stuff from Java 8 like lambdas and streams. I was developing before (like almost 4 years ago) for a company and we didn't use even Java 8. So still I'm not developing again (I wanto to pass the ocp exam before) so I'd like to know for you all if in your projects you are using all of these "new" features.

For me it's being a bit hard to assimilate all of these things because it's like a change of paradigm but It's really interesting anyway.

Cheers!
 
Greenhorn
Posts: 5
VI Editor Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do use it quite often, its very suitable when working with collections for example, some filterings, etc...
 
Greenhorn
Posts: 3
IBM DB2 Oracle Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I do. After passing my OCP exam on Java 8, I try to implement what I've learnt into my daily work. Then, I always ask myself one question during my development: If I implement this logic by Java stream, does it save obvious number of lines of code? If the answer is yes, I implement my logic by Java stream for sure.

Java stream helps me to achieve cleaner coding when manipulating elements in Java Collections and I love using it.
 
Marshal
Posts: 14399
240
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just a caveat: fewer lines of code does not necessarily equate to cleaner code. Just remember that, please. Clean code is easy to understand and easy to maintain. If you can say something in one line of code instead of five lines and not sacrifice clarity of intent then, yes, do it. If the shorter code is more cryptic, however, seriously reconsider.

The good thing is that lambdas and streams and the abstractions that they offer can often result in code that is both shorter and more expressive of intent than the equivalent imperative style code.
 
The world's cheapest jedi mind trick: "Aw c'mon, why not read this tiny ad?"
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!