Slashdot: News for Nerds


Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Book Review: Scala for the Impatient

K77 (1744374) writes | more than 2 years ago

Book Reviews 0

K77 (1744374) writes "Note to /. editors: Obviously, Scala has become a hot topic. Despite occasional mentions on /. — usually in conjunction with Facebook or Twitter — there has not been much discussion here of resources to help people learn scala. I seldom write reviews, but this book is just so good I need to share this. Please consider publishing my review, below, or making suggestions which would make it more helpful to /. readers.

If you're not using Scala yet but you've been reading about it online, you've probably noticed a lot of discussion and speculation online about which companies and how many people are actually using Scala in production. It's clear that Scala is generating a lot of interest, and similarly clear that many people haven't quite figured out whether Scala is suitable for them and their projects. IS Scala a fit for you? For your company? What does it take to become productive in Scala? "Scala for the Impatient" can help you decide for yourself and your teams. And if you decide to adopt Scala for a project, this book will also help get you going.

Let's make one thing clear from the start: "impatient" is not a euphemism for "unprepared." Bring your A-Game. This is a book for programmers who are serious about their craft. Fittingly for a language as elegant as Scala, the book is also graceful, well written and thoughtfully edited. You will learn in plain language what's essential and what's extra in Scala. There's no fluff here. Every sentence matters.

But impatience is not the book's only virtue. A wave of Scala books is coming to market. I've read several, most of which I'm unlikely to pick up again. Scala for the Impatient is different, thanks to a unique design and mission. Despite being a relatively young language, a strong dogma seems to have grown up around how Scala is to be taught by books. Not all dogma is bad. But Scala for the

Impatient deliberately breaks away from the pack in three remarkable ways:

i) not jumping immediately into functional programming;
ii) thoroughly establishing common ground with experienced Java (and C++) programmers; and
iii) dispatching re-mappable differences before introducing really new concepts

What?!? We could be forgiven for thinking that functional programming is the most important thing about Scala. That might be true, but then why has Scala — a relative latecomer to the family of functional languages — generated so much excitement? Perhaps there's more to Scala. Indeed, there is so much more that functional programming makes mostly cameo appearances before finally taking center stage in Chapter 12. That's right: Chapter 12. And I assure you, the first eleven chapters are not slow.

On the contrary, Horstmann swings for the fences on every page, because there's a lot of work to do. Not the least of this work is establishing common ground with experienced Java programmers. If you've ever wondered how much of the "chattiness" of Java is imposed by the JVM, now you know: none of it. Scala is capable of great expressiveness in good hands, so it makes sense to take a fresh look at types, objects and control before applying them functionally. You won't be bored. Like learning a foreign language, you may find that learning Scala gives you a deeper appreciation for the languages you already know.

The third remarkable trait of this book is that Horstmann deliberately addresses what I call re-mappable differences between Java and Scala. Because there is so much genuinely new about Scala, it's important not to be distracted along the way by things which may look new but really are simply remapped. Scala for the Impatient is the only book I've seen so far which demonstrates that the author really understands this. Moreover, Horstmann writes plainly about what you *must* know to be productive in Scala and which are the truly esoteric bits and when you would need them.

I won't read the table of contents to you, but I do want to mention three chapters which really stand out. You've probably heard that Scala has strong support for XML. This gets a whole chapter, and I think you'll be amazed at how natural it feels. Scala makes working with XML fun — ok, tolerable — for humans. Another brief but technically solid chapter is devoted to Actors which provide the clean, baked-in concurrency which is a major driver for Scala adoption. And there's even a chapter on the parser library embedded in Scala, which is very useful when you need to parse protocols or storage structures for example. Since parsing theory is a specialty likely unfamiliar to many readers, the essentials are summarized. While the Scala parser library won't replace traditional language recognition tools, its internal domain specific language for parsing may save you from having to jump in and out of Scala for many common tasks.

Finally, the exercises are excellent. Don't skip them! In fact, some of the exercises would make good interview questions. (Hint!)"

cancel ×


Check for New Comments
Slashdot Account

Need an Account?

Forgot your password?

Don't worry, we never post anything without your permission.

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>
Create a Slashdot Account