small medium large xlarge

Pragmatic Scala: Create Expressive, Concise, and Scalable Applications


Cover image for Pragmatic Scala

Pragmatic Scala

Create Expressive, Concise, and Scalable Applications


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.

Customer Reviews

A well-paced, easy-to-read, and practical guide to Scala for Java programmers.
Covers important aspects of this powerful multi-paradigm language, ensuring
that you can become productive with Scala right away.

- Ramnivas Laddad

Author of "AspectJ in Action", speaker, and consultant

In Pragmatic Scala, Venkat provides a solid foundation to help you get started
with Scala in a thorough yet succinct book that you can (and should) read cover
to cover. He explores the most important topics you’ll need to get comfortable with
Scala, starting with the REPL and progressing through functional programming
in Scala, handling concurrency with actors, and Java interoperability. You will
definitely want to fire up your editor or IDE and code along with the book’s numerous,
interesting, and fun examples!

- Scott Leberknight

Software architect, Fortitude Technologies

In a world of tweets, blogs, and bite-sized videos, there is still a place for the longform
narrative. It gives a teacher the time necessary to introduce challenging and
complex topics. And, if we’re being honest, Scala is a challenging and complex
topic. Take this opportunity for Venkat to guide you through the Scala language,
functional programming, concurrency, testing strategies, and more.

- Brian Sletten

President, Bosatsu Consulting, Inc.

There are two reasons why I recommend this book for all my Scala classes. It
covers the basics without insulting your intelligence and escalates you to advanced
topics without going over your head. A must-have for anyone learning Scala.

- Daniel Hinojosa

Programmer, instructor, presenter, and author of "Testing in Scala"

See All Reviews

Choose Your Format(s)

  • $24.00 In Stock
  • Ebooks are DRM free.

  • Ebook delivery options.

What You Need

The Scala compiler (2.x) and the JDK are required to make use of the concepts and the examples in this book.

Contents & Extracts


  • Getting Your Feet Wet
    • Exploring Scala excerpt
      • Scala Features
      • More with Less
      • Functional Programming
      • Wrapping Up
    • Taking Scala for a Ride
      • Using the REPL
      • Scala on the Command Line
      • Running Scala Code as a Standalone Script
      • Compiling Scala
      • Wrapping Up
    • From Java to Scala
      • Scala as Concise Java
      • Scala Classes for Java Primitives
      • Tuples and Multiple Assignments
      • Flexible Parameters and Arguments
      • Implicit Parameters
      • Strings and Multiline Raw Strings
      • String Interpolation
      • Sensible Defaults
      • Operator Overloading
      • Scala Surprises for the Java Eyes
      • Default Access Modifier
      • Wrapping Up
    • Working with Objects
      • Creating and Using Classes
      • Following the JavaBean Convention
      • Type Aliasing
      • Extending a Class
      • Parameterized Types
      • Singletons and Companions
      • Creating Enumerations
      • Package Objects
      • Wrapping Up
    • Making Use of Types
      • Type Inference
      • Fundamental Types
      • Return Type Inference
      • Variance of Parameterized Type
      • Implicit Type Conversions
      • Value Classes
      • Using Implicit Conversions
      • Wrapping Up
  • Diving Into Scala
    • Function Values and Closures excerpt
      • Limitations of Normal Functions
      • Extensibility with Higher Order Functions
      • Function Values with Multiple Parameters
      • Currying
      • Positional Notation for Parameters
      • Parameter Routing
      • Reusing Function Values
      • Partially Applied Functions
      • Closures
      • Execute Around Method Pattern
      • Wrapping Up
    • Traits
      • Understanding Traits
      • Selective Mixins
      • Decorating with Traits
      • Method Late Binding in Traits
      • Wrapping Up
    • Collections
      • Common Scala Collections
      • Using a Set
      • Associative Maps
      • Immutable Lists
      • Method Name Convention
      • The for Expression
      • Wrapping Up
    • Pattern Matching and Regular Expressions
      • Comprehensive Matching
      • Pattern Variables and Constants in case Expressions
      • Matching Using case Classes
      • Extractors and Regular Expressions
      • The Omnipresent Underscore Character
      • Wrapping Up
    • Handling Exceptions
      • Exceptions in Scala
      • Mind the Catch Order
      • Wrapping Up
    • Programming Recursions excerpt
      • A Simple Recursion
      • Tail Call Optimization (TCO)
      • Trampoline Calls
      • Wrapping Up
  • Concurrency in Scala
    • Lazy Evaluations and Parallel Collections
      • Let’s Get Lazy
      • Making Strict Collections Lazy
      • The Ultimately Lazy Streams
      • Parallel Collections
      • Wrapping Up
    • Programming with Actors
      • A Sequential Time-Consuming Problem
      • The Treacherous Paths to Concurrency
      • Creating Actors
      • Actors and Threads
      • Isolated Mutability
      • Concurrency with Actors
      • Usage Recommendations
      • Wrapping Up
  • Applying Scala
    • Intermixing with Java
      • Using Scala Classes from Scala
      • Using Java Classes from Scala
      • Using Scala Methods from Java
      • Using Traits from Java
      • Using Singletons and Companion Objects from Java
      • Extending Classes
      • Wrapping Up
    • Creating an Application with Scala
      • Getting Users’ Input
      • Reading and Writing Files
      • XML as a First-Class Citizen
      • Reading and Writing XML
      • Getting Stock Prices from the Web
      • Making the Net Asset Application Concurrent
      • Wrapping Up
    • Unit Testing
      • Using JUnit
      • Using ScalaTest
      • Using Mockito
    • Installing Scala
      • Downloading
      • Installing
    • Web Resources
    • Bibliography


Dr. Venkat Subramaniam is an award-winning author, founder of Agile Developer, Inc., and an adjunct faculty at the University of Houston. He has trained and mentored thousands of software developers in the US, Canada, Europe, and Asia, and is a regularly invited speaker at several international conferences. He’s the (co)author of multiple books, including the 2007 Jolt Productivity award winning book Practices of an Agile Developer.