Re:Java 8: New features in ConcurrentHashMap
by jay-anderson on Wednesday January 18, 2017 @11:57AM
(#13427866)
Java still has a ways to go before it catches up with the features of scala. Here are a couple:
I'm sure others have said it, but type aliases can't be done in java. For instance this is useful for seeing 'PersonId' instead of 'String'. More semantically meaningful names. You can emulate it in java, but you incur a runtime cost and have to write a wrapper class.
I'm sure others have said it, but type aliases can't be done in java. For instance this is useful for seeing 'PersonId' instead of 'String'. More semantically meaningful names. You can emulate it in java, but you incur a runtime cost and have to write a wrapper class.
Another interesting feature is value types. There is work in java to support this, but it's java 10 at the earliest (see https://en.wikipedia.org/wiki/Project_Valhalla_(Java_languag...). Since scala runs on the JVM which doesn't support value types there are cases where it has to allocate an object. (see http://docs.scala-lang.org/overviews/core/value-classes.html)