Hacker News new | ask | show | jobs
by virmundi 5367 days ago
I like Scala, though I just dabble in it. But I have a few thoughts on why it will be difficult for it to be mainstream.

One of its greatest features require a meaningful rethink of the JEE stack. Actors passing messages seems to not really work in a one thread to one request world where you should fork new threads.

There are too many ways to do the same thing in it. Manipulating maps or list can be done with various features of the collection library. This becomes the Java version of Perl. Some developers will use $_, some prefer variables and they each prefer their own ways. It can make it hard for one developer to pick up where the other left off.

Finally, the documentation seems to be more complicated than necessary. The Scala version of JavaDoc available on their site is almost a difficult to navigate as MSDN. From here we go to the books about Scala. These take careful reading to glean even the most basic structures (took me a while to figure out that the primary constructor is all of the lines between the {} of a class that isn't encapsulated by a method declaration).

2 comments

Actors ... seems to not really work in a [JEE setup].

Then don't use Actors, you can still use the rest of the language and you're still a lot better off than Java.

There are too many ways to do the same thing in it. ... This becomes the Java version of Perl.

Problems that only manifest once you have a large code base aren't barriers to adoption. Mainstream languages would be a lot better if they were! After all, Perl became widely adopted, so this didn't hurt Perl from being adopted and may even have helped.

Finally, the documentation seems to be more complicated than necessary.

I agree, and this is a problem for adoption right now. The documentation is the opposite of K&R's book on C. However, this can change easily, since third parties can write books about Scala. It's not like changing a language feature, where it takes a committee 10 years to actually make the change. Anyone can write a book, and we're starting to see that: the O'Reilly book on Scala is a really good introduction.

>Problems that only manifest once you have a large code base aren't barriers to adoption.

Ye Gods. Of course it is. If your code base is small you can pretty much get away with using anything. It's only when the code base is large enough to make maintenance challenging that differences between code paradigms start to matter.

If scala is only good for the sorts of projects PERL can handle, why would I stop using PERL?

In my view, Scala is good for projects where using Java is too complicated and you can use better abstractions.

I would argue that Scala helps to keep your code base smaller and easier to manipulate (due to extra type safety). In any language, a big codebase needs coding standards and the project develops it's own "culture". You have the same multiple approaches problem in Java: how do you search for items in a collection?

>In my view, Scala is good for projects where using Java is too complicated and you can use better abstractions.

I have yet to run into a project for which the use of Java is too complicated, and I'm concerned the designers of Scala have made a few mistakes of the kind you see in C++, like operator overloading.

To date, I have only dabbled in a few Scala scripts on top of an existing Java code base. I found it straight-forward for that job (albeit a small job). I found the "scaladoc" to be a bit sparse, but otherwise navigable. I mostly like the Scala book that the Pragmatic Programmers published (forgot author's name), other than the slow intro.

I'm sure my use of Scala would disappoint the first interviewee, but it was an effective use-case for me. Use the index on the book to scan for likely topics, then round things out with Google.

I found the IDE support a bit broken in NetBeans (6.9). I suspect that the Scala plugin was incompatible with my vi/vim plugin, but I'm not sure. (it would go into a mode where the editing keys would stop working)