[Book Review] Programming in scala vs Functional Programming in Scala Which one should you choose ?
By: Mohit Pratap Singh
Tags: Big Data, Java, Programming, Scala, Book Review

A guide for someone new to Scala as well as present Scala developers.

If you are working in Big data industry or have interest in Big data analysis, you might have come across Scala Prograaming language. With some prominent companies such as Netflix, Twitter, LinkedIn have vastly used Scala in their tech stack for creating huge data pipelines, REST API’s, its the increase in polularity of Apache Spark and Machine Learning that really made Scala widely used.

Programming in Scala by Martin Odersky, Lex Spoon, Bill Venners

Lets get it straight, if you can write good enough code in Scala, you won’t learn anything exceptional and can sprint through the book in couple of weeks while picking some clever tricks and techniques that you may not be familiar with. But if you are new to Scala or you are a Java developer and interested in Scala, then look no further.The Fact that the Book is written by the same person who created Scala, Martin Odersky, this books covers all the INs and OUTs of Scala that you will ever need to know and should serve you well when you get stuck while building real life projects.

Personal Take — I read this book ‘after’ I started coding in scala but the quality of my code then was quite rudimentary and this book really helped me to take my coding standards in Scala to the next level. It took me 3–4 weeks to go through the book and always learned something new in almost every unit (although you can skip units on XML processing, GUI programming if you wish to), Even till date, I still found myself coming back to this book whenever I need to.

Functional Programming in Scala by Paul Chiusano, Rûnar Bjarnason

While the book Programming in Scala is more focused on core Scala concepts, the Functional Programming in Scala as the name suggest targets the functional aspects of Scala. Remember Scala is one of the those language which provide equal support to both Imperative(Object oriented) and Functional styles, although to make full potential of Scala, it is recommended to adopt more of functional programming paradigms (I will try to cover the topic of functional programming with comparison to Imperative programming in another article). I think the core techniques taught in this book are not limited to Scala and can be implemented to other languages which are functional in nature. The inclusion of exercises at end of chapters is definitely a plus.

Personal Take — This is the book that taught me a whole new deal about Scala and its potential and what huge amount of work you can do with just a couple of lines of code. Due to this book, I was able to understand and implement the FP paradigms (for eg treating functions as first class variables, exclusions of mutables) in production. At first, you may cope some difficulty in understanding the FP concepts, but if you even do couple of problems at the end of every unit, you will slowly be able to percieve and eventually master the FP coding style in any language let alone scala.

Final Verdict

Even though Programming in Scala encourages you to adopt FP, the main focus is on demonstrating various aspects and utilities provided in Scala library in a very begineer friendly fashion. It is the F.P. in Scala that teaches the techniques and capabilities of FP which can be applied to harness the full potential of scala, but can be a bit intimidating to begineers. So if you are new to Scala you should definitely go through Programming in Scala and after that if you are also interested in FP paradigms then refer to F.P. in Scala to grasp the functional usage of Scala.