

Scala Pros and Cons - ghotli
http://jim-mcbeath.blogspot.com/2010/12/scala-pros-and-cons.html

======
jbarciauskas
_If you believe, as I do, that a given programmer can produce roughly the same
number of lines of code per day independent of the language used, you can see
how this reduction of lines of code can translate into a substantial increase
in productivity and a faster time-to-market._

Do people actually believe this? It seems to me the time spent typing actual
lines of code is dwarfed by an order of magnitude by the time spent thinking
between writing each line or method, cut and pasting for refactoring, etc. To
borrow Fred Brooks' terminology, I think the most common languages at this
point - certainly Java, Ruby, and Python - are at a high enough level that we
spend an order of magnitude more time on fundamental rather than incidental
complexity.

~~~
swannodette
Not true at all. I encounter incidental complexity all the time when writing
code in Java, Ruby, and Python. Especially when I need to interface with
_other_ libraries and _other_ frameworks.

Ruby, Python, Java deal with the expression problem very poorly. The desire to
write code generically is real so you have the mess of generics and people run
to dynamic langs. In dynamic langs the desire to monkey-patch is real because
you often need to extend objects whose source you do not control. In dynamic
langs you often want an extension point, _that does not a mean a list of
methods to call_ , rather a list of method signatures to implement so I plug
my own functionality in w/o reading through your source.

All this adds up to countless hours wasted.

These are real problems in real software _today_ that current mainstream
languages address very poorly.

~~~
ghotli
Thus summarizes the negatives. Do you have any examples of languages with
effective solutions to the expression problem?

~~~
swannodette
Scala (implicits, structural typing) and Clojure (protocols, extend-type) both
have great solutions to these problems. Anyone know of other langs that deal
with these issues properly?

~~~
Zaak
Haskell has type classes and type inference which seem like they would be
helpful.

~~~
joshhart
Scala has (limited compared to Haskell, but still powerful) type inference and
a way to simulate type classes as well.

~~~
gtani
Scala type inference is still evolving (as are clojure, and, I think, haskell
and F#)

[http://www.reddit.com/r/scala/comments/ectzr/why_no_type_inf...](http://www.reddit.com/r/scala/comments/ectzr/why_no_type_inference_in_scala/)

------
Dove
_Scala provides tools that allow highly competent developers to write very
concise code, and if you give them those tools they will use them. Developers
who are less competent may then have trouble understanding that code._

A wise co-worker of mine once said that it is just miserable when you have to
maintain code written by someone smarter than you. So I strive to be concise
and clear, but very rarely can I justify using arcane features and concepts to
achieve that goal.

------
jamesaguilar
I'd like to add one to the "Cons" list. This language is even bigger and more
complicated than C++. If that doesn't scare you, I don't know what will.

~~~
henning
It's actually smaller and simpler than Java or C++ as far as I know. It's
designed to have fewer edge cases and employ a smaller number of powerful
features instead of many less-expressive ones.

It's interesting that you use the word "scare." It's a computer language.
What's there to be afraid of?

~~~
jamesaguilar
> It's interesting that you use the word "scare." It's a computer language.
> What's there to be afraid of?

I guess you haven't read very much C++ code. :P

With respect to the intent of its design versus the outcome, I can think of a
few things that have been difficult for me in my playing with Scala. Implicit
parameters, type parameters in general, especially the <: and >: operators,
and some things like :/ and Ordering.by have confounded me quite a bit. The
limited nature of its point-free style is also kind of difficult to get in --
IMO, they should have left that out entirely because two ways to do something
is often worse than one. The distinction between = and = { at the end of
method declarations, when you do and don't have to put parens on a no-arg
method, and various other little quirks of the syntax are also a little
annoying.

Don't get me wrong. I'd far rather program in Scala than C++ on a day to day
basis. But, it seems quite large to me. It's a subjective measure, but that's
my assessment as a professional C++ programmer and a beginner Scala
programmer.

------
isomorph
When people say Scala is too complex, are they talking about functional
programming?

~~~
johnm
No, it's the interactions between all of the boatload of features of the
language that causes the explosion of complexity.

~~~
isomorph
Right. The OO subtyping combined with the type system makes it complicated. I
don't mind that, but another consequence is the limitedness of the type
inference, which is kind of annoying.

------
johnm
Scala is to Java as C++ is to C.

~~~
technomancy
Not really; Scala is actually better than Java.

