Thoughts after Reading: Scala for the Impatient
Scala is probably not the best first programming language to learn, but it makes a very valuable second if you have time to sit down and review all the language has to offer. Scala was the second language I learned after Python, and I have felt a tremendous amount of value added to my knowledge of programming and software engineering because the language is so much different than the first one I learned in many, many ways. As a former mathematics student, functional programming feels intuitive, and programming in Scala feels safe, if done correctly. Scala for the Impatient, by Cay S. Horstmann, was the first book I read to learn Scala, and I am very glad I made that decision from the several Scala programming books I’ve read thus far.
Scala for the Impatient blasts through the fundamentals of the Scala programming language in a very approachable manner. Each chapter, most under 20 pages, is split into a myriad of very relevant subtopics that keeps the reader attentive. Chapter 1 of most technical literature is usually too intuitive and verbose and gets a little too invested into explaining how to install software that if you are merely interested in just diving in and getting started, Chapter 2 is usually a good starting place. This is not so with Horstmann’s book. Chapter 1 already jumps into writing working scala code and, as much to my appreciation, learning through example.
A good programming question doesn’t keep you guessing, doesn’t give you the answer, but leads you to a short 5 minute exercise that ignites further interest.
The review questions at the end of each chapter in this book are amazing. They don’t feel like homework from CS101, nor are they Stage 3 Google Codejam problems. A good programming question doesn’t keep you guessing, doesn’t give you the answer, but leads you to a short 5 minute exercise ignites further interest. A question that asks you to fill in the blank doesn’t really spark a student’s mind (as we can remember from our favorite substitute teachers and their endless packets), and a question that asks you to reproduce some unexplained phenomena about Monads isn’t a good question, especially for a first time learner to Scala. Working through the end-of-chapter exercises in Scala for the Impatient is an absolute must if you want to reap the full value from the text.
This book is not all praise however, and this might just be me and my aversion to some topics I don’t fully understand the importance of yet. As a complete newbie to programming, I thought the world revolves around JSON, so when I stumbled across Chapter 15, XML PROCESSING, I more-or-less completely skipped over it. This also might be a trend with the Java ecosystem, because many other Java texts also contain topics on XML. A few other topics possibly worth skimming over are package objects in chapter 7, and parsing in chapter 20 if you really, really want to just get started writing scala. Chapter 20 is very valuable though because it enables you to write domain specific languages which is a big feature of Scala that you will often interact with, but from my experience, rarely write.
Chapters that are worth a high investment of time for the new Scala programmer are 2, 10, 13, and 14. These chapters are fairly approachable for someone who has very limited knowledge of typed and functionally-embracing languages. In addition, these chapters are definitely not skippable, you will likely reference all four when you glance at someone’s Scala code for the very first time, so stay diligent during these chapters.
You can (and should) read Scala for the Impatient line-by-line.
Reading through Scala language features after only knowing Python makes Python feel a bit dry, and that’s probably intentional. Many of the features in Scala make writing code fun, and many more make it extremely powerful, so getting a proper understanding of Scala and what it has to offer is a necessity. I’ll gladly throw people to the lions when it comes to writing Python, but Scala should come with compulsory research. Scala will let you solve one problem countless ways, and without research, you might never come across the language features that would make your life writing code so much easier. You can (and should) read Scala for the Impatient line-by-line. It doesn’t read like a novel, like some more experienced and functional Scala books which I’ll be soon to review.