3 ms·
Scala has some very nice features for making Java's libraries much nicer to deal with. The most useful are probably implicit definitions and parameters, operato
by shankys 19y ago
Scala has some very nice features for making Java's libraries much nicer to deal with. The most useful are probably implicit definitions and parameters, operators (any method may be used as an infix or postfix operator), and target typing. You can often "Scalify" a library using these features. See [1] and [2] to see what I mean. These features are also great for creating DSLs.
The recent Scala 2.6 compiler brought some other niceties like structural types (imagine duck typing with a static type system), existential types, and lazy values.
All in all, I've been thoroughly impressed with Scala.
[1] Pimp my Library: http://www.artima.com/weblogs/viewpost.jsp?thread=179766 http://www.artima.com/weblogs/viewpost.jsp?thread=179766
[2] Simplifying JDBC: http://scala.sygneca.com/code/simplifying-jdbc http://scala.sygneca.com/code/simplifying-jdbc
- henning 19y agoYes, you definitely can Scalify things. But having to write boilerplate facades for every library you want to use in a nice way significantly diminishes the utility of Java compatibility. I meant to say that this is one of the biggest drawbacks of using Scala (along with slightly immature docs). It has an excellent design; it feels like a much bigger language than Java, yet the Scala spec is a fraction of Java's. It is overall an extremely nice thing.