I have been using Scala now for two years and have integrated it into projects I am working on in the professional business world. Just so there is no misunderstanding, I consider myself to have a very decent skill level with the language and I have been programming in general for 31 years, 23 of them professionally. I have written two books on Java and consider myself an expert on that language. Furthermore, I am actually a FAN of the scala language itself (minus the issues below) so this is not an attempt to flame war scala into hell but rather a desire to offer constructive criticism. Minus the issues below I would much rather write scala than Java despite my java expertise. This post is not targeted, therefore, to tear down the language but to recommend that it take some different directions.
Having worked for 2 years on one particular very complicated project, I have formed some conclusions about Scala from the trenches. The project uses the latest version of Play Framework and SBT and integrates Akka as well. It is written partially in Java and partially in Scala with Scala being many of the controllers and only a few of the entities. The design of the project is a standard play application with Non-Anemic domain model, since I rather strongly agree with Martin Fowler's condemnation of the POJO pattern. The application handles tens of thousands of concurrent users, must be transactional and has real time streaming components.
In using Scala on this project I have a number of observations to convey.
1) In my opinion the absolute worst aspect of Scala is the rampant use of Implicit conversions. They make the code nearly impossible to follow when reading it in the IDE in many situations. While I understand their motivation, it tends to go seriously sideways and results in the creation of Opaque DSLs that just serve to confuse. When it comes to cross training Java developers into Scala I might as well be stirring a pot of witch brew and doing some Voodoo for all the junior developers understand. My company has neither the resources nor the time to send the staff to a couple months or even weeks of training. Since implicit have become so rampant in Scala, the language is being polluted and I find it hard to defend against the notion that it is an Obfuscated C Code contest on Steroids. Furthermore since most conversions between Java and scala are done with implcits (for collections) it makes writing interoperable code a complete pain.
2) A close second to Implicit Conversions is the introduction of Macros. Again i understand the base reasoning but the resulting mess it creates makes code nearly impossible to debug. Generated code has always been an impediment to effective debugging but this takes it to a whole new level. Furthermore, since macros exist they have prevented better solutions from being invented to the problems that macros address. I am reminded of STL in C++ and some of the nightmares with #IFDEF and #DEFINE that are well known to render C++ programs unreadable.
3) SBT should be renamed "Screwed Up Build Tool". A language lives and dies on its tools and SBT needs some serious work. I suppose that is why it hasn't even reached a 1.0 release. Its slow, cumbersome, often flighty. Our play application, for example, will spontaneously recompile the entire codebase when I change a comment in a file or introduce a new private variable. It will sometimes do so twice, iterating the whole codebase. The fact that SBT is sensitive to double spacing is fundamentally FUBAR.
4) Integration with major development environments like IntelliJ and Eclipse is minimal and works but often just barely. Again, a language lives and dies on its tools. In my opinion Trpesafe (the org pushing scala) should be spending SIGNIFICANT resources making the perfect plugins for these two major toolsets. I am an intelliJ fan and scala plugin for that platform works ok but not nearly to the extent that the java integration works. For example, intellij fails to understand and deal with any of the scala templates for views in Playframework. This is with the Play plugin and integration working.
5) While Implicit and Macros have been added to make the language more complicated significantly more simple additions to the language for more practical features have been flamed by the community and not implemented. For example a keyword readonly (or similar keyword) on a scala var to allow the variable to be written by the class but not by external members of the class. The only solution is to declare a private member then declare getters and not setter. This is a silly miss on the part of the language since it would be so useful. The standard response from the community is that everything should be val but this is not realistic when you have to integrate with existing code and have complexity of language mixing to deal with.
6) And this is meant in the most honest constructive way possible. The community has some issues when it comes to dealing with others. New users are often ridiculed for lack of knowledge and derided for not knowing some of the most obscure facets of the language. I suppose this makes the "experts" in the community feel superior but does nothing to advance the cause of scala. Quite the opposite. In addition much of the advice is given from an academic perspective rather than a practical one. People in the business world have no ROI to re-implement the whole system to Scala purity and simply want do so. Advising them to do so is tantamount to advising them "scala is not for you" and that is hardly beneficial to the development of the language. Most developers that make a language go big will be business developers and not academics. Business developers have to balance things like ROI and resources, not simply advocate developmental purity and this is not a scala specific mantra either. Its just reality of business life.
Anyway those are my opinions and I am sure I will be flamed below but these are my honest impressions and in fact much more mild than most of my colleagues that i have tried to push to learn scala over the last 2 years.