I love Scala. My difficulties with it were wrapping my head around some of the magic syntax it has. E.g., this looks nice:
l match {
case a :: b => println("hi")
}
This looks very neat, but it means I need to understand:
- What is match: so I see it is syntactic for unapply on the object in the case. What is that object?
- I then find that objects can have any name. Specifically, here it is '::'
- Then, there's a special syntax for binary extractors in case where a :: b translates to ::(a,b)
- And then realize that println comes from predef where it is typedefed to the real println in System.out.
So a simple snippet leads to a lot of learning.
The other hurdle is that many blogs are full of mind bending tricks you can do. Where's in Java the blogs are usually on how to work with an API, scala blogs are more about how you can bend the language.
The final one is convincing people that scala is worth it. I think the crux of the issue is that most java developers want a language to work with other APIs. The language is a "glue" to facilitate use of collections,hibernate,spring, etc. Scala makes the "glue" feels nicer, so what? In my case, the reason I learned scala is because the CTO decided he loved the language and so made my team learn it and also established a study group. But when his focus changed to do other things people immediately went back to java.