
Graham’s Guide to Learning Scala - grlea
http://www.grahamlea.com/2012/11/learning-scala-grahams-guide/
======
luu
Another resource for learning Scala is Werner Hett's 99 problems in Scala:
<http://aperiodic.net/phil/scala/s-99/>. I tried it after doing Odersky's
Scala class (<https://www.coursera.org/course/progfun>). If you've done the
class, it's not a bad way to get some practice with constructs that weren't
particularly useful in the class.

If you haven't done the class, the problems are simple enough that you could
probably learn scala by just working through the problems and googling for
relevant syntax. They start to get more involved around problem 50, but, by
that point, you'll have a good grasp of the syntax.

If you want to try them out, I have unit tests for the problems I've done
(only up to 58, so far) here: <https://github.com/danluu/ninety-nine-scala-
problems>. The tests are pretty rudimentary; I'm sure there's at least one
github repo that has more comprehensive tests, but I looked around at tens of
repos of other people's tests on github when I first started and I didn't find
much.

P.S. If you're in Austin, there's a Scala group that gets together that isn't
a meetup, and hence, isn't findable from Graham's link in step 9:
[https://groups.google.com/forum/#!forum/austin-scala-
enthusi...](https://groups.google.com/forum/#!forum/austin-scala-enthusiasts).
The majority of the folks there actually use Scala in real production code.

~~~
JohnCohorn
The ATX group is indeed a good one.

------
tokipin
the Coursera course "Functional Programming Principles in Scala" just ended
but they're keeping all the content online until the next run of the course

the lecturer, by the way, is the designer of Scala

<https://www.coursera.org/course/progfun>

~~~
pohl
It was an awesome course. I can't wait for part 2.

------
RyanZAG
Scala was looking pretty nice till I got to this:

[http://www.codecommit.com/blog/scala/scala-for-java-
refugees...](http://www.codecommit.com/blog/scala/scala-for-java-refugees-
part-6)

Not convinced on Scala being a good language to use for multi-person projects
anymore. Same as with C++, you would have to heavily push code reviews and
coding standards (disallow everything from that link?) in order to have even
slightly maintainable code...

~~~
bad_user
That's only a superficial impression and I recommend you give it a second
chance.

If you're worried about the equivalent of "open classes" from Ruby, first of
all in Scala implicit conversions are always scoped and statically type-
checked, and second, that article is out of date.

~~~
seanmcdirmid
Can't you use traits and type member to simulate open classes? At least, this
used to be possible, but then the compiler stopped letting us define type
member bounds recursively around the time I left the project.

Implicit conversions are a poor substitute to real open classes.

------
bad_user
I don't think this is a good guide for Learning Scala.

The Introduction from scala-lang.org and a Tour of Scala are not good
introductions. They are meant as a TL;DR that will leave you scratching your
head and reading the list of features without the larger context of a language
is an awful way to learn about that language.

IntelliJ IDEA with the Scala plugin is a good IDE, but the article should have
included a link to the Scala-IDE plugin for Eclipse. It's not friendly for
beginners to make them install a plugin, which is why Typesafe is already
providing a download of a completely configured Eclipse here:
<http://typesafe.com/stack/scala_ide_download>

Also, when starting out with a language I would rather use a plain text editor
and the compiler directly, because complicated tools bring with them
complicated problems ... Hello World with just the compiler is just one text
file that you can directly execute, versus the notion of whatever a project is
in an IDE. And you should start with the REPL anyway.

" _Scala for Java Refugees_ " is an article series that's out of date and not
that good frankly. There already is a comment here from somebody saying he was
scared when he saw in that series the usage of implicit conversions - a
feature that in Scala 2.10 is considered experimental, for really advanced
use-cases and that has to be enabled manually, as for most purposes there are
better solutions available - but on the other hand, the context of a feature
matters a lot. Implicit conversions are great for dealing with the "
_expression problem_ " and through their means, Arrays (a fundamental JVM
data-structure with a broken interface) behave like plain Seqs in Scala, while
Strings are considered to be lists of chars (as in Haskell or Lisp).

I didn't like Alex Payne's " _Programming Scala_ " book. It's boring, it's
poorly organized and it's out of date - for instance a big part of it involves
dealing with Scala's Actors, but Scala's Actors were terrible, which is why in
Scala 2.10 the implementation in the standard library gets replaced with Akka,
which is the defacto standard anyways, but it also has a slightly different
API and concepts. Actors are also the kind of powerful construct that's not
easy to tame, being an awful way to start learning Scala ... before Akka
Actors, look into Scala's Parallel collections, or into Akka's Futures and
Promises or into ScalaSTM.

Speaking of Parallel Collections and Futures and Promises, no mention of
Scala's Documentation project?

<http://docs.scala-lang.org/overviews/>

A much better introduction to the language is " _Scala for the Impatient_ ", a
book that wasn't mentioned and one third of the book (enough to get you
started) is available from Typesafe's website: [http://blog.typesafe.com/free-
pdf-from-typesafe-scala-for-th...](http://blog.typesafe.com/free-pdf-from-
typesafe-scala-for-the-impatien-64715)

You also cannot write about learning resource, without mentioning "
_Programming in Scala_ " by Odersky, a wonderful book also meant for human
beings. Its only problem is that it's a tome of information and you may not
have the patience for that, but it's not a hard to digest book so if you've
got the time and patience, then this is THE book you should read:
<http://www.artima.com/shop/programming_in_scala_2ed>

And you must also mention " _Scala in Depth_ " by Joshua Suereth, which is
like the equivalent of "Effective Java", a ~ 300-pages book you definitely
must read once you're done with "Scala for the Impatient":
<http://www.manning.com/suereth/>

On the other hand the Coursera Course taught by Odersky on Function
Programming is awesome. I've took it and it was worth every minute of it.

~~~
irahul
> You also cannot write about learning resource, without mentioning
> "Programming in Scala" by Odersky, a wonderful book also meant for human
> beings. Its only problem is that it's a tome of information and you may not
> have the patience for that, but it's not a hard to digest book so if you've
> got the time and patience, then this is THE book you should read:
> <http://www.artima.com/shop/programming_in_scala_2ed>

+1

The book is huge, but that's more to do with the fact that Scala is one
kitchen sink of a language than the writing.

~~~
bad_user
The book is huge because it goes to great length at explaining good design
practices, the rationale of features in the language and how they are
implemented under the hood, not mentioning functional programming and OOP
concepts ... many of the exercises from SICP also appear in this book.

It's a complete reference to the language and I've never seen a reference that
isn't huge.

Scala is not a kitchen sink. The number of features included is quite small
and for the most parts orthogonal, but because those features are very
powerful, their combination is a little overwhelming for beginners. This
happens in every language that's not meant for assembly lines. Even for Java,
learning is not complete without reading another book on patterns and another
one on effective usage of it.

~~~
silentbicycle
> It's a complete reference to the language and I've never seen a reference
> that isn't huge.

Lua's reference is 112 pages. Just sayin'. (Also, online at
<http://www.lua.org/manual/5.1/> .)

~~~
seanmcdirmid
All generalizations are false :)

Lua's design philosophy is to keep it simple, which works well for their user
base and domain of use (lots of embedding in games as a scripting language).
Scala is not meant to be a simple scripting language, its more like a power
language. Both are very good languages.

~~~
silentbicycle
Indeed, and Lua gets a lot simpler because it can shrug stuff outside its
scope onto C.

(The Definition of Standard ML is also pretty short, though... ;) )

------
mukaiji
Anyone has a good summary of Scala vs Go? I know a bit of the former (with
typeface for high-concurrency) and was wondering what Go might have to offer.

~~~
irahul
Go is far simpler and smaller. You can learn go in an evening. It comes with a
nice standard library, but the ecosystem isn't as lively as what you get on
JVM. But if you have native library for a task, using it from Go is straight
forward. Web frameworks are in their infancy. Writing network programs in Go
is a pleasure. You write code in the natural way(no callback spaghetti) using
go-routines, and go takes care of making it non-blocking. The go oop is
structural sub-typing based. Though it might seem lacking at first glance,
it's actually quite wonderful.

Bottom line: Learning go is far simpler than learning Scala. Read and write
some programs, and make up your mind. Here is an example you should read
through to get a feel of the language.

<http://golang.org/doc/codewalk/sharemem/>

~~~
bad_user
C is far simpler and smaller than Go. Languages are optimized for different
things, depending on their context. They all have a place.

~~~
irahul
> C is far simpler and smaller than Go.

Mentioning Go is simpler than Scala is to point out the difference to OP, and
to emphasize that trying out Go doesn't take much effort.

> Languages are optimized for different things, depending on their context.
> They all have a place.

I am not denying that. That's why I said - _Read and write some programs, and
make up your mind._

~~~
bad_user
Yeah, I like modern languages that don't need an IDE or other complicated
mechanisms to get started. Go seems to have made a lot of good design choices
too.

------
mintplant
Previous title: "Do something useful over the holidays: Learn Scala"

------
millennium2
That article looks seriously outdated. I think everyone following that advice
will get a bad first impression of the language.

------
account_taken
Just read Twitter's Scala guide. Best resource for learning Scala on the web.

------
hakaaak
The two problems I have with Scala are: (1) it tries to be too much by
allowing optional types and the clarity of the code suffers- either embrace
duck typing or don't, (2) Play v2 killed all chance of it becoming a decent
web developer's go-to language.

For those that are learning Scala just for the hell of it, great. But, don't
intend to make a career out of it unless you've checked into other languages
first, like Ruby, Python, Haskell, Go, Clojure, etc.

~~~
millennium2
I try to understand what you try to say and have several interpretations, but
sadly none of them seem to make sense.

What do you mean with 'optional types' and what does that comment about Play
have to do with Scala?

Care to explain?

------
djb_hackernews
Add to resources/community #scala on irc. When I was doing Scala app dev, it
was a wonderful place with a small group of really helpful people.

------
donwb
Perfect timing! Learning Scala is exactly what I'm doing over the long
weekend.. Great post!

~~~
thebluesky
Also check out: [http://blog.typesafe.com/free-pdf-from-typesafe-scala-for-
th...](http://blog.typesafe.com/free-pdf-from-typesafe-scala-for-the-
impatien-64715) In my experience most people find that the best introduction.

~~~
donwb
Thanks! will do.

------
sherjilozair
Great blog post! I wish someone has this kind of tutorial for Haskell.

~~~
lazyfunctor
This kind of tutorial for haskell will be great! I think LYAH is a good
starting point for haskell beginners.

------
MaxGabriel
Does anyone have something like this for Clojure?

~~~
jcurbo
You might check out the book "Seven Languages in Seven Weeks" which has a
chapter on Clojure (and Scala, Ruby, Io, Prolog, Erlang and Haskell too). I
took a class that used it and I thought the format was quite good.

~~~
braco_alva
Thanks for mentioning the book, after reading your comment I looked for the
book, and it looks pretty good, probably the next book I'm going to buy.
Thanks!

------
pknerd
Can anyone tell me why one needs to learn Scala but not something else like Go
or Node.js? Some other buzz word?

~~~
seanmcdirmid
No. I mean, you should learn what you want to learn; there is no strict set of
new technologies that you should learn and others that you shouldn't. Sorry we
can't provide you with better guidance.

