Sunday, November 17, 2019

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

Scala is one of the relatively new programming languages which encompasses best practices of many programming languages. The biggest strength of Scala is that it provides a beautiful blend of object-oriented programming and Functional programming. So, you can not only construct elegant class hierarchies for maximum code reuse and extensibility, but you can also implement their behavior using higher-order functions. It has a concise syntax with less ceremony, which also makes it ideal for scripting but doesn't underestimate its power. Like Java, Scala has also used for mission-critical applications by technical giants like Twitter, LinkedIn, and Intel.


Let's be honest, learning Scala is not easy, even for experienced Java programmers. When I started learning Scala, the syntax looks quite different to me. Being used to the verbose style of Java, the brevity of Scala looks cryptic to me, but once I learned, that brevity is what I liked most.

Another challenge while learning Scala comes in the way of learning functional programming concepts, like monads, lambdas, etc. Since I have never used any functional programming language like Haskel and Lisp, it was quite overwhelming for me.

I even stopped learning Scala for a few weeks before I restarted when I gain some ground on functional programming. That's why in this list of best books to learn Scala, I have also included a book on functional programming using Scala.

Even though there is a lot of free material is available online, and even Scala documentation is a great source to learn Scala, I found learning from the book is the best way to learn a new programming language.




Top 5 Scala and Functional Programming Books

Here is my list of some of the best books to learn both Scala and Functional Programming. You can first start learning Scala programming concepts by starting with the first book on this list and then move to learn more useful functional programming concepts by using the second book on this list.

You must read at least these two books if you really want to master Scala because the second book will show you how you can use functional programming concepts to solve real-world problems, which are a very useful skill if you are looking for a Scala development job.

Many programmers think that just learning scala basics like case classes, traits, scala collection, and optional is enough to get a Scala programmer job, but that's not true. If you are serious about becoming a Scala developer, you must understand functional programming concepts like the map, reduce, fold, flatmap, monads, and lambda as well. Just learning Scala basics won't be enough to get a Scala programming job on Twitter, LinkedIn, or Intel.





1. Programming in Scala 3rd Edition

This is by far the best book to learn Scala, particularly for Java developers. Having a designer of Scala programming language, Martin Odersky, as the co-author of the book, really helps in terms of providing more depth on concepts.

The 1st and 2nd edition of the book was a huge success, and the revised 3rd edition covers Scala 2.12. You can use this book as a reference because it provides comprehensive coverage of all Scala concepts and features. It also discusses similarities and differences between Scala and Java, which makes this book more valuable for experienced Java programmers.

In short, Programming in Scala 3rd edition by Martin Odersky, Lex Spoon, and Bill Venners is a must-read book for Scala programmers, and if you want to learn better, you can combine this book with Rock the JVM! Scala and Functional Programming for Beginners course on Udemy.

how to learn Scala read this book




2. Functional Programming in Scala

When I first started learning Scala, the most challenging part for me was functional programming concepts, e.g., monads, lambdas, carrying, etc. Even though initially struggle with Scala syntax because it is very concise and less readable, the FP concepts bother me a lot until I read the Functional Programming in Scala 1st Edition by Paul Chiusano and Rúnar Bjarnason.

This is seriously one of the best books to learn Functional programming concepts irrespective of language. Even if you are not learning Scala, you can read this book just to refresh or learn functional programming idioms and ideas. It teaches Scala and Functional programming by leading you through exercises where you are expected to work out key features of the Scala library for yourself.

One of the drawbacks of the book is that there aren't many examples or illustrations about how to use Functional programming to solve real-world problems, So I recommend reading "Advanced Analytics with Spark" at the same time. Both of these books complement each other.

Top 55 Books to Learn Scala and Functional Programming



3. Scala for the Impatient

Let me put the big disclaimer first, I am a big fan of Cay S. Horstmann. Having read his Java 8 for Inpatient and Core Java Volume 1 and 2, I was sure that Scala for the Impatient will be a great book. The 1st edition of the book was a big success, and now you have the 2nd Edition of Scala for the Impatient by Cay S. Horstmann.

The revised 2nd edition of the book covers Scala 2.12 and current Scala usage. The book is written for experienced Java, C++, or C# programmers who are new to Scala or functional programming. This book introduces the key Scala concepts and techniques you need to know in order to start coding in Scala. It is the perfect introduction to the language, particularly for impatient readers who want to learn the fundamentals of Scala so they can become productive quickly.

Best book to learn Scala




4. Scala Puzzlers

This book is similar to Java Puzzlers by Neil Gafter and Joshua Bloch. I like this kind of text because it helps you to learn the programming language in depth by exposing the corner cases. The headline of the book, "The fun path to deeper understanding," ultimately justifies the content. In short, Scala Puzzlers by Andrew Phillips and Nermin Šerifović is a must-read book for experienced Scala programmers. Even though you have been using Scala for a couple of years, you will learn a couple of things for sure.

Best Scala book for experienced programmers



5. Scala in Action

Having been read many titles on the action series, like JUnit in Action, Hibernate in Action, or Spring in Action, I was confident that this book will also keep the tradition intact. The books are full of examples and teach you many day-to-day tasks by adopting how to do this in the Scala approach.

The book covers Scala 2.10 and last updated in 2013, so it is a little bit out-of-date now, but you can still use it to learn the core, Scala. The hands-on examples are the fundamental strength of this book. It will also teach you how to use Java and Scala open source libraries, debugging, and test-driven development with Scala.

5 Books to Learn Scala and Functional Programming



That's all about some of the best books to learn Scala and Functional Programming. The best thing about learning Scala is that you will get the best of both worlds, like object-oriented techniques as well as functional programming goodies.

To be honest, the learning curve of Scala is a little bit difficult, especially if you are from Java background and never used any functional programming language like Haskel or Lisp, but, once you crossed that barrier, you will love things which you hated when you start learning Scala, like syntax. So all the best with Scala, a better job and a better salary too.

Further Learning
Scala: Getting Started
Learn By Example: Scala
Rock the JVM! Scala and Functional Programming for Beginners


Other Recommend books by Me you may like to explore

P. S. -  If you are looking for a Scala job, you may like to practice some of the frequently asked Scala Interview Questions, which has been requested by many companies. You can check them here, and if you need some online courses to learn Scala, you can check this list of free Scala courses here.

No comments :

Post a Comment