Couple of learnings about Scala (copied from a chat I had with an ex-Googler friend of mine asking about my thoughts about it):
- It's hard to read the code quickly (code concepts / 100 char line) with all the implicit conversions, language specific peculiarities, compositions, etc., you used to be able to read code by glancing, with scala you can't because the density of logic vs. characters can suddenly jump within a single line (e.g. one line you have an assignment to a val, the next one is the reversal of a list, implicitly converted from a java list, then a flatmap on the output that extracts a collection, partitioning by some predicate, ... all on one line)
- Build tools don't work perfectly with scala (some application servers don't like the code it generates, but that's not to blame the language itself), it doesn't co-exist with java in some corner cases (meaning we need to write java anyways, JPA for one, if you need typed criteria query meta-model classes)
- Hard to find scala programmers and training them takes a while (from java)
- The actual productivity gains are not that much after a while; an IDE is good for eliminating a lot of the cruft of java and you realize that you don't actually save that much from coding
- The libraries encourage you to trash the heap quite a bit without too much thought (since it's so easy), with java though, you are actually more aware of allocations and performance since there's less magic happening
Then the more specific issues:
- XML support in scala is nice but when you need true marshalling and unmarshalling, you are back to some java-based framework
- The provided types are nice but once you start mixing java frameworks and scala frameworks, you have to be real careful passing in a Scala list of BigDecimal since even if the conversion is done properly to yield a Java list, the BigDecimals in it still needs another round of unwrapping
- It's actually nice to just use iteration rather than making it real "scala-ly" and issue a chain of function calls on collections to do what you want. I understand that you can still do iteration in Scala but it's just too tempting to be cool and instead instantiate a whole bunch of functions (which, again, are actual classes in the JVM) and create a bunch of throw-away intermediate collections
- Then, there's always the debate about whether to pass a Buffer, List, Seq, Collection, Traversable, TraversableOnce around. :) With Java, it's easy to suggest that functions should take in the most flexible inputs while returning the most specific outputs (i.e. taking in Collection<T> and returning a List<T>)
Okay, I still really do like the fact that you don't need () everywhere and must end a line with a semi-colon though. That and the fact that you are more inclined to use "final" variables.
