
A Year Of Scala - DanielRibeiro
http://blog.joa-ebert.com/2010/12/26/a-year-of-scala/
======
Homunculiheaded
As someone who has spend a fair amount of time with Haskell, Scheme, Common
Lisp etc, can someone give me some insight into what's really exciting about
Scala? There seem to be a lot of people I respect using it, but most of the
articles I've read are of the form "coming from Java, Scala is awesome!" which
I haven't found particularly enticing. Every time I look at examples I don't
really see anything that sticks out as particularly interesting. I really want
to get excited about Scala, and would really appreciate any insight that would
help me with this.

~~~
z0r
Just the pleasures of a powerful type system, inference, pattern matching,
higher order functions... The usual good stuff, but on the JVM. I was paid to
learn and program in it for a good five months earlier this year (everything
ended up getting ported to python later...) and yes, it basically boils down
to "coming from Java, Scala is awesome". If you have to build on top of the
JVM and the Java ecosystem of libraries, it is a fine choice.

~~~
krosaen
Which do you prefer? Python or Scala?

~~~
z0r
I enjoyed writing Scala more than I enjoy writing Python, but there are a few
undeniable advantages that Python holds over Scala. The motivation to port
from Scala to Python was to avoid the lengthy build process that had been
slowing down development to a crawl. There may have been other ways to
alleviate this, but by the time the port was completed, it took a good 15 - 20
minutes to get the build machine to compile and package the entire project so
it could be deployed to production. At this time rapid fixes were critical.

Also, the team as a whole prefers Python to Scala... I took pleasure in
learning how to express my code in increasingly functional and compact ways,
but my coworkers found struggling with the type system to be too much of a
headache. In particular, there are rough edges when you are integrating Scala
code with Scala types and data structures with Java code with Java types and
data structures. In any case it will be easier to find programmers who write
in Python than those who might write Scala.

Scala gave me more personal pleasure to write in, but Python isn't bad either.
I miss the type system and the many classes of errors it could help prevent at
compile time, but I appreciate being able to change Python code and put it to
the test immediately. The loss of expressiveness is probably made up in part
by being forced to write code that is more easily read. I still hope I will be
able to find a job writing in a functional language in the future...

~~~
runT1ME
Great response. How many LOC was your project that you got that amount of
slowdown? Would you say it was the primary reason even over some developers
struggling with the type system?

I'm a huge Scala fan but even after a year of hobby programming here and there
I feel like a beginner...

~~~
z0r
I could pull up the LOC, but it honestly wasn't the Scala compilation that was
the true issue. The true issue was that the project was built with maven and
it had a tremendously large number of dependencies. If all the Scala in the
project had been converted to Java, the build still would have been
monstrously slow. So the port was more of an escape from the JVM than an
escape from Scala - and yes, the build times were the primary reason for the
port. As for the type system... not a single other person left on the team
misses Scala but me. (The primary Scala evangelist had been let go for
unrelated reasons)

------
code_duck
Great article. I've been learning Scala for a while now as time allows, and
have had similar experiences - the syntax is tricky at first, and much of the
community focuses on CS esoterica that isn't familiar to me, but the major
concepts are quite familiar, coming from Python, Scheme and JavaScript. I'm
still looking forward to my moment of epiphany when I realize I've become
vaguely competent with Scala.

~~~
sharednothing
Scala is the C++ of the JVM based languages.

~~~
runT1ME
I disagree completely. C was a well designed language that was later added
onto haphazardly and you ended up with C++.

The Scala language designers took a long time examining the shortcomings of
java and other languages and ended up improving them, and at the same time
coming up witha much smaller language specification.

If anything, Java was the C++ and Scala is the C.

~~~
sharednothing
Please point out the "shortcomings" of Java. It has done quite well and
provably "scales" from programming in the small to enterprise level. Even the
required detour of multi-core resulted in the industry's gold standard of
memory models: JMM.

"Much smaller language specification" is a red herring. The issue is
(practical) comprehension.

"C was a well designed language that was later added onto haphazardly and you
ended up with C++."

[http://www.amazon.com/Design-Evolution-C-Bjarne-
Stroustrup/d...](http://www.amazon.com/Design-Evolution-C-Bjarne-
Stroustrup/dp/0201543303)

I've read that book. (Have you?) Nothing "haphazard" about C++.

~~~
code_duck
I consider verbosity and lack of closures to be shortcomings of Java.
Apparently, so did the author of the article here.

~~~
sharednothing
Its perfectly fine to note that Java can be verbose and that it does not fully
support closures. It is perfectly fine to consider these "shortcomings".

However, in context of OP's comment above, the strong suggestion made was that
shorcoming == poorly designed.

And that is a completely wrong assessment of Java and its designers. It is an
exceptionally well thought out _system_ and _language_. Again, the proof is in
the pudding. Google and Oracle are not fighting over scala ...

~~~
somnium
They're not fighting over Java, they're fighting over the JVM. Java isn't
worth fighting over.

~~~
sharednothing
The fact remains that the JVM was designed for Java and mirrors its semantics.

The "shortcoming" of Java is due to none other than the JVM:

[http://java.sun.com/developer/technicalArticles/DynTypeLang/...](http://java.sun.com/developer/technicalArticles/DynTypeLang/index.html)

------
mike4u2
I did a few spare time projects with Scala, but does (did) anyone use it for
commercial applications? If so, what kind?

~~~
harryh
I decided to implement (nearly) all of foursquare.com in scala.

~~~
codexon
Do you have any problems with GC pauses?

~~~
harryh
Yes, on occasion. We've combatted this in a couple of different ways:

1) Rewriting code to make fewer memory allocations or, in some cases, allocate
memory for shorter periods of time (so it doesn't get promoted to a longer
lived heap)

2) Garden variety GC tuning. Tune the various heap sizes, and GC algorithms
used.

------
Luyt
This article demonstrates the beauty of taking away cruft until you only have
the essential stuff left. I like Scala's succinct way of anonymous function
notation.

------
Create
[http://www.boost.org/doc/libs/1_45_0/libs/graph/doc/using_pr...](http://www.boost.org/doc/libs/1_45_0/libs/graph/doc/using_property_maps.html)

------
sharednothing
"I was tired of writing code like this over and over again."

This _is_ getting tiring:

    
    
       public class MyGraphThingee extends Graph<Foo, Bar>

~~~
zoul
Doesn’t this issue mostly go away when using a decent editor? I also found out
that while I don’t particularly enjoy writing boilerplate code, it gives me a
second to rest my brain, relax, think about the context etc. I think I like
the resulting "rhythm changes".

~~~
sharednothing
Judging by the upvotes, the comment was misread. The point was that it is
trivial to extend the generalization to avoid verbose references and type
names.

~~~
Luyt
Does Java have typedefs nowadays?

~~~
sharednothing
No. Don't need them.

<https://gist.github.com/755824>

~~~
veemjeem
are you some kind of java troll?

