
Scala School - alongtheflow
http://twitter.github.io/scala_school/
======
pcx
Learning Scala is such a pain. Either you follow a large book completely and
master it across several months/years or go through overly complicated online
guides and get discouraged. I understand it's a large, advanced language, but
the community has to seriously work on making things a bit easier for
beginners like me. Just look at how easy it is to learn Go or Rust, their
official tutorials are amazing and free on the web.

Here is what worked for me to learn the basics well: I started off with the
book 'Scala for the Impatient', the first half of the book is freely
available. I then used Scala School as a list of topics and researched on each
using Google. StackExchange has some amazing answers that helped me a lot.

Free part of Scala for the Impatient: [http://fileadmin.cs.lth.se/scala/scala-
impatient.pdf](http://fileadmin.cs.lth.se/scala/scala-impatient.pdf)

~~~
StreamBright
The real question: is it worth it? Up to now I could successfully avoid
learning Scala. My problem with it is the complexity that the language by
itself introduces and the readability of code that comes out at the end. Maybe
I am just valuing simplicity too much when it comes to programming languages.
Anyways thanks for the impatient guide!

~~~
plinkplonk
If you have to use the JVM _and_ don't want to code in Java, your options are
Scala or Clojure (maybe Groovy?). Then it comes down to essentially the
tradeoff between a static typesystem vs macros (imho, ymmv etc).

I second the reccomendation for Chuisano and Bjarnasaon's "Functional
Programming in Scala".

~~~
networked
Kotlin and JRuby appear to be your next best options after Scala and Clojure.
Both have growing user communities (thanks to Rails in the case of JRuby and
Android in the case of Kotlin). Both solve the library problem by offering
seamless compatibility — with Java and MRI (with some caveats [1])
respectively. If you start a long-term project in JRuby you'll be able to hire
Ruby programmers down the line. Kotlin is a less safe bet in terms of hiring
but I except its prospects to become clear soon, probably within a year.

[1]
[https://github.com/jruby/jruby/wiki/DifferencesBetweenMriAnd...](https://github.com/jruby/jruby/wiki/DifferencesBetweenMriAndJruby)

~~~
networked
The last sentence above should say "I expect".

------
sheldor
A well known resource (albeit a bit outdated); however I'm genuinely curious
why is this on the front page of hacker news.

I thought at first that it's been updated to some 2.1X version but, judging by
the github repo, it hasn't been touched for years.

~~~
rco8786
Also expected this to be an update or something. Strange.

------
Zaheer
My biggest problem with Scala is that it's too powerful. Reading code I've
written weeks or even days later is painful. Conciseness is not always good.

~~~
joshlemer
In what ways does Scala you've written end up being unreadable just days
later? I honestly find that Scala code is some of the simplest and easiest to
reason about of any language. Writing Scala has honestly been such a joy, it's
easy to refactor, easy to read and write, and I almost never miss something --
if it compiles, Scala code is usually correct I find.

~~~
rtpg
I think that, if you're not super aware of most of the features of Scala, that
it can be confusing to understand what certain syntax means (implicits are a
big one!)

Just the infix operator syntax plus implicits can lead to stack trace
confusion all around

And try understanding some of the type signature funkiness! It can be
difficult

I definitely think that Scala is a harder language than most to grasp, if only
for the feature support not seen since C++

~~~
lmm
Scala's infix operator syntax is very mechanical. Much easier than e.g. Python
where you have to remember whether a * b desugars to a.__times__(b) or
a.__star__(b) or something else. The IDE support for those and for implicits
is very good these days.

The type signatures can be complex but only when you're doing complex things
with them - if you stick to doing the kind of things you'd do in another
language you'll get similarly simple types.

You're absolutely right that the native stack traces are poor, but you can use
tools that understand them better, e.g. Takipi.

------
taude
I was learning Scala at one point. I was reading Atomic Scala [1] (I'm a big
fan of Bruce Eckel as I learned Java from one of his earlier books, and some
C++ before that). And I also took the Coursera Course from Martin O on
functional reactive programming with Scala. I don't remember what is was
actually called...

I'm still into alternative languages that run on the JVM...however I went and
learned Go Lang in a weekend and it meets a lot of my needs for building out
newer services.

Also, for my team the overhead of learning another JVM language (we already
use Groovy quite a bit) didn't seem worth it in the end, even though I was a
bit of a fan of the Scala idea for a few months.

I might still learn Scala some day, but we're not even on Java 8 at my current
job, and that would alleviate a lot of my current Java grievances....

[1] [http://www.atomicscala.com/ebook/](http://www.atomicscala.com/ebook/)

~~~
vorg
Don't let your experience with Apache Groovy put you off upgrading to a new
JVM language. I learnt Clojure after using Groovy for a few years -- Groovy
1.8 was the last version I used. I then looked at Haskell, and now I'm using
Go.

------
Negative1
Maybe I'm in the minority on this but I felt this guide by twitter was poorly
written. It has good coverage but concepts were just not explained very well.

The way I learned was reading from front to back "The Scala Programming
Language" by Martin himself and starting a new project completely in Scala
(which I'm launching soon). I'm sure that's not the best approach for everyone
but using Scala in a practical environment in an idiomatic way really helps
ground the concepts which can at first seem intimidating and difficult to
comprehend.

Mastery is a whole other story...

p.s. I recommend Scala Cheatsheet if you are just learning:
[http://docs.scala-lang.org/cheatsheets/](http://docs.scala-
lang.org/cheatsheets/)

------
merb
What I hate about Scala School is that they are still using Twitter Future's
and not Scala Future's, that could be aweful for Beginners.

~~~
hythloday
Twitter's Futures were developed when Scala's Futures weren't tail-recursive
(and so not really production-quality). There's probably an item on the
roadmap to port Finagle to using scala.concurrent.Future but I doubt it's high
priority. The two support the same set of operations in any case - I doubt
it'd be a huge problem for a beginner to translate one to the other.

~~~
merb
Actually a Huge difference is that scala.util.Future takes a implicit
ExecutionContext while com.twitter.Future does not.

~~~
hythloday
It is for production. It's not for a beginner - they should just be using
scala.concurrent.ExecutionContext.global.

------
gamapuna
Can anyone recommend a good scala based open source project which gives a
flavor of how to write good/effective scala

~~~
lmm
Do you want basics or advanced? At the moderately fancy level, Spray is great
- any time you're using a directive, you can just click through in the IDE and
see the implementation of what it actually does. And Doobie is a tour-de-force
for advanced type constructs. At a more basic level a lot of Twitter's own
libraries are straightforward readable code (e.g. Scrooge is one I've patched
a bit myself), though coupled to the Twitter stack of Finagle/Scalding/etc.
that you probably don't want to use.

------
denisftw
Scala for the impatient is a 400 page book that essentially teaches the syntax
:) I can recommend a drastically less time-consuming algorithm:

1\. Watch a 1-hour video that teaches HelloWorld-stuff in Scala:
[https://www.youtube.com/watch?v=DzFt0YkZo8M](https://www.youtube.com/watch?v=DzFt0YkZo8M)

2\. Then read first 45 pages (free sample) of my book
[https://leanpub.com/modern-web-development-with-
scala](https://leanpub.com/modern-web-development-with-scala)

------
ikurei
(Somewhat off-topic, sorry)

This book does an interesting thing:

> For each chapter (and occasionally for individual sections), I indicate the
> experience level. The chapters progress through levels A1, L1, A2, L2, A3,
> L3.

The number is the expertise level, from junior to expert; A stands for
Application developer, L for Library developer.

I often find myself unsure about wheter a book or text is intended for the
kind of user I am for whatever the topic is. Skimming through a book trying to
identify what parts you should focus is not always easy.

Do you know of other books that do this kind of thing?

~~~
randomThoughts9
I find this schema, promoted if I'm not mistaken by Martin Odersky himself, as
one of the biggest marketing blunders possible as far as programming languages
are concerned.

You keep telling developers that they are not good enough but they should rest
assured that some smarter people are working on the problem and they'll come
back with the answers.

When in reality, I think that all developers, when using a library, would like
to think that they could have written it themselves, it they would have had
the time or the interest.

------
bsaul
are there any other big company relying on scala for their core infra ?

~~~
joshlemer
Walmart, EnerNOC, Verizon, LinkedIn, Hootsuite, Coursera, Foursquare,
Meetup.com, Nitro, Workday, AirBnB, there's quite a lot..

~~~
_snydly
I'm curious, why Scala over all other options?

~~~
lmm
It's a fantastic language. It combines the conciseness and readability (if you
stick to sensible method names) of Python with the safety of OCaml and the
performance of Java. It combines the type-level power of Haskell (i.e. the
ability to explicitly sequence effects) with traditional OO
inheritance/subtyping and performance behaviour you can reason about (helped
by the JVM's well-established profiling/instrumentation support). If you want
to use a single language for everything, it can scale up to critical core
codebases and down to throwaway scripts / interactive notebook-type use. What
else would you use?

~~~
_snydly
> What else would you use?

Oh, no, I was asking mostly as a noob. I've since decided to have a go at
learning Scala, and your answer reinforces that decision.

------
sidcool
I recently gave a talk on basics of functional programming. I have observed
Scala syntax comes easier to people than Haskell or Clojure.

------
SriniK
Curious question, anyone here using Scala for Android development?

~~~
flurdy
I spoken to many that have made Android apps with Scala but none that have
pushed them to the appstore as the final binary is always quite big even for
simple apps.

~~~
Nutomic
I wouldn't say that's true. I have an app written in Scala [1], and the apk is
just 4 MB. Sure, that's more than a comparable Java app, but many apps reach
20+ MB due to graphics anyway.

[1]
[https://play.google.com/store/apps/details?id=com.nutomic.en...](https://play.google.com/store/apps/details?id=com.nutomic.ensichat)

------
brakmic
The Dark Side for Beginners ;)

------
diimdeep
Isn't scala dying ?

~~~
jinst8gmi
As someone who's seeing plenty of Scala uptake around me that's a rather
surprising claim with no supporting evidence. These days I'm writing 90+% of
my code at work in Scala.

Indeed.com job data suggests that the answer to your suggestion is an obvious
"No":
[http://www.indeed.com/jobtrends/scala.html](http://www.indeed.com/jobtrends/scala.html)

~~~
incepted
This graph shows that Scala grew from 0.02% market share to 0.08% in the last
four years. The fact that it's at 0.08% after more than ten years in existence
should be a concern for anyone interested in learning it.

~~~
jinst8gmi
For comparison Ruby is just over 0.3% and has been flat for four years. It's
the overall job market, not just programming jobs so all percentages will be
low.

~~~
incepted
Sure, so this tells us there are about 20 times as many Ruby jobs than Scala
ones.

~~~
jinst8gmi
0.3 / 0.08 = 3.75

That's less that 4x as many Ruby jobs as Scala ones.

------
partycoder
I have heard that Twitter is now moving away from Scala.

~~~
nolite
Any source ? Any idea why?

~~~
murph
I work at Twitter.

No, we're not. Probably just some rumor.

------
jowiar
My biggest challenge with (learning) Scala and the Scala community is that it
feels like nobody is actually shipping software, or advocating for making
shipping software easier.

And that's a shame, because Scala is language I love for writing a few dozen
lines of code, and expressing a domain concept. It's a fantastic language for
solving a homework problem set (and it's origins may be part of the reason
why). But every library feels like it was concocted as a search for purity
with zero attention given to the user experience.

The community is badly missing a DHH or Kenneth Reitz -- someone saying: "Ok,
it's cool that we have this academic purity stuff and all that, now let's get
serious about shipping software, and making tools that help people ship
software." It's not that this view needs to dominate a community, but right
now it's thoroughly unrepresented in Scala land.

~~~
akavi
Twitter? Foursquare? Linkedin?

(Also my old company, PagerDuty. Wee bit lower profile than the other three,
admittedly.)

~~~
jowiar
None of whom are producing well-supported public code / documentation /
conference talks.

Edit: And to clarify. I think part of this is because there's a serious case
of imposter syndrome among Scala developers. I feel like much Scala code I've
written would make legitimately useful open source projects, but I'm not
really happy with the interface, and I feel the innards could be a bit
cleaner, so I don't release it, because it feels just hackish enough that I
trust it myself, but don't want the outside world depending on it. I'm
probably not the only one here.

