Tuesday, April 11, 2023

Top 5 Books to Learn Java 8 and Functional Programming - Best of Lot

Hello guys, recently, I asked my followers on Twitter which Java version they are using in production, and most of them said Java 8 and Java 11. This is not surprising at all because many of the Java and Spring Boot projects I have worked on also using Java 8 in production. After close to 7 years of Java 8 release, it is still the most used Java version in production which is not surprising though. Even though we now have Java 20 but many programmers are yet to learn Java 8 and I often receive queries like which books to read or which online courses to join to learn essential Java 8 features like lambda expression, stream, and functional programming. 

If you are learning Java 8 features like lambda expressions, Stream API, and functional programming in Java and looking for some exciting books and resources then you have come to the right place. In the past, I have shared some of the best Java 8 tutorials and courses and today I'll share some of the best books you read to learn Java 8 better. 

I will not only tell you which books to read but also why read that particular book. I know that online courses are getting better and better every day, and even I am using them to learn new technologies like Spring 5 and Java 14, but books still have their place because they provide the most in-depth coverage of any topics, which is needed to master the subject and become an expert.

Online courses or classroom training courses are excellent, but they only focus on 20% of concepts which used 80% of the time, which is excellent to start with but won't make you an expert, and that's where books can help you.

Btw, if you are in a hurry and just want a book to start, then you should just read  Java SE 8 for Really Impatient from Cay S. Horstmann. Why I recommend this book? Three reasons, first clarity, second, size of the book is not overwhelming, and the third and most important, I was able to connect to this book.

I didn't find it boring or feeling sleepy as soon as I started reading, which in my opinion, is a litmus test for any book. Since Java 8 is significantly different from the earlier Java version, thanks to the functional programming approach introduced in this release to take advantage of multicore CPU, programmers are finding it hard to grasp new concepts.

Questions like which books should I refer to start learning Java 8? or what is the best book to ascertain Java 8 is increasingly seen in various places on the internet. I had started learning Java 8 in 2014, even before Java SE 8 was released, and I have gone through many books in the past year.

When many of my readers asked me to suggest an excellent book to learn Java 8, I thought about writing this blog post and sharing my experience with some of the best Java 8 books.

These books are equally useful for beginners and senior and experienced Java programmers looking to learn functional programming in Java 8. And, if you want to complement an online course, I suggest you join The Complete Java MasterClass, which is the most up-to-date course, recently updated for Java 11.





5 Best Books to Learn Java 8 and Functional Programming

It's been a long time since Java 8 was launched in March 2014, and the number of Java developers looking to learn Java 8 features like lambda expressionstreams, and new Date and time API is increasing exponentially.

Even though Java has moved at a faster pace and we are now waiting for Java 12, most of the Java development still happens on Java 8 because it's challenging to keep pace with Java versions for organizations and developers.

Without any further ado, here is my list of some of the best books to learn Java 8 and functional programming. If you are learning Java 8, then these books will help you to become the master of Java 8 new concepts and functional programming.

1. Java SE 8 for the Really Impatient by Cay S. Horstmann

I have read many books while learning Java 8, but the best book I found is Java SE 8 for Really Impatient from Cay S. Horstmann. This book is both short and sweet; you won't feel bored while reading the books and learn the details which otherwise go unknown.

If you are interested in learning about all the new features of Java 8 and not just functional programming aspects like lambda expression and streams, then this is the best book.

You will not only learn about functional programming features, like, lambdas, streams, functional interfaces, but also about the new Date and Time API, JavaScript Nashorn engine.

If you want, you can also combine this book with Learn Java Functional Programming with Lambdas and Stream course by fellow Java developer and Udemy best seller instructor, Ranga Rao. It's a good course if you want to learn Functional programming with Java.

5 Good Books to Learn Java 8 Functional Programming

It also includes several other miscellaneous goodies, including some of them from Java 7 like an improved way of reading and writing files, using the try-with-resources statement to automatically closing resources, etc.

Another reason I am recommending this book and why I found it so useful is because it's written by Cay S. Horstmann. If you have read any book authored by Cay in the past, like Core Java Volume 1 and 2, then you know why I am suggesting his books.

His books have clarity and explain critical concepts in fewer words with simple, easy to understand, but non-trivial examples. Btw, it's not necessary that you will also be able to connect to his book like I am, so it's better to try a couple of them before settling in for one.




2. Modern Java in Action: Lambdas, Streams, and functional-style programming by Manning

Action series has already made its name in the programming world, and Java 8 in Action also lives up to the expectation.

Right from the beginning of why lambda expression was introduced in Java, they have made a great effort to teach new features of Java 8 in a simple and easy way. Modern Java in Action: Lambdas, Streams, and functional-style programming are a collective effort of Raoul-Gabriel Urma, Mario Fusco,  and Alan Mycroft. Previous this book was also know as Java 8 in action. 

Great book to learn Java8

I got this book a little late, and by the time It arrived, I already know a lot of things about Java 8, but one thing which this book helped me is to understand the motivation behind key Java features, like lambdas, functional programming, streams, etc.

I highly recommend this book to experience Java developers who want to learn functional programming in Java 8. It's not a generic book on functional programming techniques but still gives you enough exposure on how to do them in Java 8.





3. Mastering Lambdas: Java Programming in a Multicore World by Maurice Naftalin

This is one book I was waiting to be published ever since I come to know about it, and this is also one of the latest books I am reading on Java 8.

Maurice Naftalin is not new to the Java world, his last book about Java Generic and Collection is one of the best books on the topic and recommended by every Java programmer.

He is also a pioneer in explaining the motivation behind Java 8 and various of its features on his website  Maurice Naftalin's Lambda FAQ.

good book to learn Java 8


All that experience has helped him to write another masterpiece. A couple of highlights of this book is why lambda expression was needed in today's world and how it will change Java programming.

Code examples are also very well written and, most importantly, very well explained. You can get a feel about it as soon as you start reading books and chapters about internal vs. external iteration.

I highly recommend this book to any intermediate Java developer who wants to learn Java 8 and also wants to understand the why part of it.




4. Functional Programming in Java: Harnessing the Power Of Java 8 Lambda Expressions By  Venkat Subramaniam

I am a big fan of Venkat Subramaniam, I have seen a couple of his talks about Java 8 and Scala, and I like the way he explains things.

Venkat has clarity, conciseness, and a focused way of teaching with little humor, which is very important to teach a programming language like Java or Scala.

I would especially recommend this book to Java beginners who want to learn Java 8. Venkat has done an excellent job of transitioning from the old imperative way of Java coding to the new, less error-prone, and more expressive functional style of Java coding.

It's also fun to read and really enjoyable.

Java8 books

The only thing which it lacks is depth, and hence, I wouldn't recommend it to be senior and experienced Java programmers who already know about functional programming, but for someone who is starting Java 8 from scratch, this is the best book to learn Java 8 for beginners.


5. Java 8 Lambdas: Pragmatic Functional Programming by Richard Warburton

I have also enjoyed reading this OReilly Java 8 Lambdas and Functional programming book as someone who already knows a little bit about functional programming and new features of Java 8, but I found it does cover the new Java 8 APIs quite well.

This book does a really nice job of how Java 8 lambda expression and stream API fit in naturally into the existing Java ecosystem.

Java 8 books with examples


That's all in this list of a couple of good books to learn Java 8. I have learned a lot from Java SE 8 for the Really Impatient book, and this is my first book for every Java developer to start with. Beginners can also take a look at Functional Programming in Java book by Venkat Subramaniam, and for experienced Java developers who want to learn functional programming in Java 8 couple of good books are Java 8 in Action and Mastering Lambdas: Java Programming in the multicore world by Maurice Naftalin.

In general, I read at least two books just to get ideas from two different styles of authors. I have always found reading multiple authors complements your reading and learning. Alternatively, you can combine online courses like The Complete Java MasterClass with any books I have mentioned above.

Good luck on your journey to Java 8 and let us know if you come across any other Java 8 book, which you think is really great and should be on this list.

Other Java Programming articles and resources you may like:

P. S. -  If you just want to learn more about new features in Java 8, then please see these Java 8 development courses. It explains all the essential functions of Java 8, like lambda expressions, streams, functional interfaces, Optional, new Date Time API, and other miscellaneous changes.

8 comments:

  1. Mastering Lambda only cover lambdas and streams it doesn't cover all new Java 8 features e.g. new date time package, concurrency enhancement like CompletableFuture, Optional and other API enhancement. If you want to learn just these key concept then mastering lambda is great but if you want to learn Java 8 then I guess Cay S. Horstmann's Java SE 8 for really impatient and Raoul Urma's Java 8 in Action is great book.

    ReplyDelete
  2. Great post.Looking forward to read those books.

    ReplyDelete
  3. Great Overview !!

    Functional programming has finally found its way to java !!

    ReplyDelete
  4. If you seriously want to become a good programmer , I suggest to take a look at these books to learn Algorithms. You should be good at algorithm and data structure to write good code. Once you done, that you can look at these books to improve coding skill .

    ReplyDelete
  5. Hi Paul, I am David Mayer at www.java8certificationquestions.com
    I just wanted to announce that we just released our Java8 professional certification simulator.
    It is currently available for beta testing for 0.99 dollars.
    Take a look at at www.java8certificationquestions.com

    ReplyDelete
  6. why again back to functional programming?

    ReplyDelete

Feel free to comment, ask questions if you have any doubt.