Hacker News new | ask | show | jobs
by lmm 4869 days ago
The Java ecosystem is not terribly usable from Scala - even if you can call all the methods, it's not idiomatic, it will expect Java collection types etc. And few of the worthwhile parts of Java's libraries are 20 years old.

You can build cool stuff in scala + e.g. wicket, I've done it, but there's an extra layer of awkwardness to deal with that doesn't exist with python/django.

1 comments

Could you further explain why calling Java methods from Scala is not idiomatic? I have virtually no real exposure to Scala, but a decent amount of Clojure experience. I've found in my pet Clojure project that it's not really painful to wrap up calls to Java libraries in idiomatic clojure (in fact I'm writing the graphics renderer in Java for performance). Does Scala really make it that much trouble to call Java methods?
Scala makes it as easy as it can, but it just feels awkward; collection types are the most obvious thing; method names don't follow the same conventions, different types are expected for callbacks (you can use implicit conversions to mitigate this, but it's still a bit cumbersome), Java libraries sometimes return null in a way that no Scala library would. Some libraries expect classes that follow the JavaBean conventions, which look hideous in Scala (there's an annotation to tell scalac to generate JavaBean methods but it won't count them for implementing interfaces, so it's not actually useful). There are no showstoppers and it would probably be hard to do better when the languages are so different, but there's just loads of little niggling irritations to slow you down.