Foreword

I'm not sure where I first came across the Scala language. Maybe on a forum for programming language enthusiasts such as Lambda the Ultimate, or maybe in more pedestrian quarters: Reddit, or the like. Although I was intrigued at first blush, I owe my deeper exploration and enthusiasm for the language to two individuals: David Pollak, creator of the Lift web framework, and Steve Jenson, a former colleague at Twitter and generally brilliant programmer.

Following David and Steve, I arrived to Scala in the late-middle stage of the language's history to date. By 2008, Scala had spent five years evolving from its initial release, and had formed around it a tight-knit community of academics, tinkerers, and even a few consultants. The mailing lists were full of spirited debates, announcements of exciting libraries, and a general camaraderie and shared joy for seeing what this powerful new tool could do. What Scala lacked, at that point, was a collection of success stories around major production deployments.

The decision to use Scala at Twitter, where I then worked, was not an easy one to make. Our infrastructure was buckling under the weight of extreme growth. Picking a relative unknown as our language of choice for building the high-performance distributed systems that would keep our fledgling service alive was risky. Still, the benefits that Scala offered were (and are) compelling, and our engineers were quickly able to produce prototypes that proved out the language's effectiveness.

In the intervening time, I've seen a heartening number of companies large and small adopting Scala. In that time, too, the question of Scala's complexity has been raised. From the outside, Scala's many features might appear to be a kind of complexity. To understand Scala, though, is to understand its goal of being a scalable language. You can be writing real-world code in Scala in an afternoon. As your understanding of the language and, indeed, of the art and science of programming as a whole expands, there's more of Scala there to wield to your advantage. That's not complexity. It's flexibility.

To be clear: Scala will challenge you. That's part of the joy of using it. You won't understand the full power of its type system by the end of your first day. You won't understand the zen of objects being functions and functions being objects in your first week. Each feature of the language is another light bulb waiting to switch on over your head. I'm certain you'll enjoy the experience of being gradually illuminated as you read this book and write code. I've watched programmers learn Scala on the job and succeed. It can be done, and it can be fun.

As Scala programmers like me have grown to better understand what this powerful language can do, so too has Scala evolved to meet programmers' needs. Scala 2.8 smoothes out some rough spots in the collection libraries and adds useful features like named and default arguments to methods. While Scala has been a perfectly productive language to work with for some time, as of 2.8 it feels even more solid and polished. The new 2.8 release is icing on the cake.

In my experience, Scala was ready for production deployments two years ago. Today, it's even better, and I can't imagine building a new system without it. Presently, I'm doing just that. For me, Scala has gone from being a risky gamble to a trusted tool in two short years. I look forward to taking advantage of the latest features in Scala 2.8, and to using this book as the definitive reference for it, direct from the creator of the language I've grown to depend on.

Alex Payne
Portland, Oregon
October 27, 2010

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset