Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Java 8 and functional programming  RSS feed

 
Bruno Sant Ana
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft,

I've been reading in many places about the new functional programming features of Java 8. I don't fully understand what functional programming means. What's the difference between OOP and functional programming style? Can you please clarify this here? If It's not possible to explain it here, I would like to know if your book clarify this subject.

Thank you in advance.
 
Campbell Ritchie
Sheriff
Posts: 55333
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you know how OO programming differs from procedural programming? In functional programming, you can go to extremes and have no data in the program at all. Any information would be supplied via inputs and arguments.
 
Campbell Ritchie
Sheriff
Posts: 55333
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also have a look at Mike Thompson's post here.
 
Raoul Gabriel
Author
Greenhorn
Posts: 20
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bruno,

We have a whole chapter dedicated to answer your question (chapter 11). You will find everything you need to know there.

In a nutshell, OOP and FP are not mutually exclusive. OOP is in general about abstracting over data (objects and state) whereas FP is about abstracting over behaviour (functions).

There are many common characteristics that FP languages have and encourage mostly based on the idea of mathematical functions. To give you a taster we made a quick video about what it means for Java: https://www.youtube.com/watch?v=Rd-sqHjmfB0
 
Bruno Sant Ana
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you guys for all replies.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!