-
Programming-in-Scala-2nd.pdf下载
资源介绍
I’m not sure where I first came across the Scala language. Maybe on a fo-
rum 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 frame-
work, 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 proto-
types that proved out the language’s effectiveness.
Intheinterveningtime, I’veseenahearteningnumberofcompanieslarge
and small adopting Scala. In that time, too, the question of Scala’s complex-
ity 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.
Youwon’tunderstandthefullpowerofitstypesystembytheendofyourfirst
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 program-
mers’ needs. Scala 2.8 smoothes out some rough spots in the collection
libraries and adds useful features like named and default arguments to meth-
ods. 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 with-
out 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