Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Functional Programming in Java: useful for people with Java 8 experience?  RSS feed

 
Krystian Kowalski
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello and welcome to the ranch !

People with some, let's say ... solid basics experience with java 8 will find something usefull in book ? I have good understanding about streams, lambdas, FP etc but i am really curious about "SHARING MUTABLE STATE WITH ACTORS" or even "SOLVING REAL PROBLEMS WITH ADVANCED TREES".
Can you say more what's gonna be about ? Or some other more intermediate-advanced topics in your book ?

Thanks !
 
Pierre-Yves Saumont
Author
Ranch Hand
Posts: 98
17
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Functional Programming in Java: useful for people with Java 8 experience?


It is difficult to answer this question not knowing exactly what you mean by Java 8 experience. Functional Programming experience is different. If you have a very strong Functional Programming experience, you will of course find some exercises too easy.

"Sharing mutable state with actors" presents a solution to the problem of asynchronously sharing mutable state. Sharing mutable state synchronously is (relatively) easy. You just have to include the state in the result returned by state mutating functions. You can then compose functions, passing state along. Of course, there is a chapter about how to do this... functionally. But if you are building multi-threaded applications, you will sometimes want to pass mutable state from one thread to another. In imperative programming, one thread just put the state somewhere where in can be picked up by another. The consequence is that you must use mechanisms to deal with concurrent accesses. Using actors allows abstracting both the use of threads and the need for protecting against concurrent accesses. This chapter is only a presentation of a minimal actor framework that mimics the main functionalities one can find in more sophisticated actor frameworks like Akka. It shows how one can handle sharing in a multi-threaded environment without having to use mutable references, nor threads, nor synchronization nor other locking mechanisms.

"Solving real problems with advanced trees" is about creating truly usable trees (meaning balanced trees that guarantee that all operations may be done without causing stack overflow). Application includes general purpose Red-Black tree (with removal), tree maps and heaps.

Other intermediate topics include recursion, laziness, state handling, functional input/output, and more.

By the way, mastering Java 8 (and Java in general) will make all concepts easier to master. The book make heavy use of concepts like parameterized method declarations and parameterized method calls. Some readers were surprised by these concepts (although they are absolutely standard Java), especially parameterized method calls.
 
Krystian Kowalski
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it seems to be a great book I think, i will find something for me.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!