Our industry is moving toward functional programming, but your object-oriented experience is still valuable. Scala combines the power of OO and functional programming, and Pragmatic Scala shows you how to work effectively with both. Updated to Scala 2.11, with in-depth coverage of new features such as Akka actors, parallel collections, and tail call optimization, this book will show you how to create stellar applications.
The first edition of this book was released as Programming Scala.
Our industry is moving toward functional programming, but your object-oriented experience is still valuable. Scala combines the power of OO and functional programming, and Pragmatic Scala shows you how to work effectively with both. Updated to Scala 2.11, with in-depth coverage of new features such as Akka actors, parallel collections, and tail call optimization, this book will show you how to create stellar applications.
This thorough introduction to Scala will get you coding in this powerful language right away. You'll start from the familiar ground of Java and, with easy-to-follow examples, you'll learn how to create highly concise and expressive applications with Scala. You'll find out when and how to mix both imperative and functional style, and how to use parallel collections and Akka actors to create high-performance concurrent applications that effectively use multicore processors.
Scala has evolved since the first edition of this book, and Pragmatic Scala is a significant update. We've revised each chapter, and added three new chapters and six new sections to explore the new features in Scala. You'll learn how
Safely manage concurrency with parallel collections and Akka actorsCreate expressive readable code with value classes and improved implicit conversionsCreate strings from data with no sweat using string interpolationCreate domain-specific languagesOptimize your recursions with tail call optimization Whether you're interested in creating concise, robust single-threaded applications or highly expressive, thread-safe concurrent programs, this book has you covered.
What You
The Scala compiler (2.x) and the JDK are required to make use of the concepts and the examples in this book.
Dr. Venkat Subramaniam, founder of Agile Developer, Inc., has trained and mentored thousands of software developers in the US, Canada, Europe, and Asia. Venkat helps his clients effectively apply and succeed with agile practices on their software projects. He is a frequent invited speaker at international software conferences and user groups. He's author of .NET Gotchas (O'Reilly), coauthor of the 2007 Jolt Productivity award-winning book Practices of an Agile Developer (Pragmatic Bookshelf), and author of Programming Groovy (Pragmatic Bookshelf).
While the book introduces the reader briefly to many areas of the language, it does so in a fairly chaotic way, resulting in a number of forward references, sometimes excessive backward references (yes, I know you already wrote about option types). It's rather awkward how many times over a rather short chapter I read a full bibliographical reference to Goetz06.
The book skips a number of topics that you would expect in systematic presentation of the language (comments? basic builtin types?), presumably assuming reader would know those from Java, but then explains basics of anything related to functional programming in a terribly patronizing way. This adds to the feeling of chaotic presentation, and reminds you that it might be rather outdated despited being updated to Scala 2.11.
The amount of space devoted to classpaths and ways of compiling and running examples from the command line is weird. One would expect that Java programmers would already know how classpath works, or at the very least wouldn't mind needing to look it up.
In Pragmatic Scala, Venkat gives an overview of everything Scala has to offer. He does this mostly from the standpoint of a Java developer. So you will get most out of this book if you have a Java background.
Given the vastness of the topic, Venkat does a very good job. He clearly explains the main concepts of the language and where it differs from Java.
Unlike many others, this book can also serve as a concise reference. The content is well organized and relevant sections are easily found.