|
|
|
|
|
by cgh
4654 days ago
|
|
The major issues for a lot of people are simply cosmetic clutter: having to specify types everywhere rather than some basic type inference, for example. Other problems are deeper: no first-class functions, no tail-call recursion support in the JVM (Clojure has a hack to deal with this), no map/fold/etc. equivalents that can potentially aid with parallelization. I think 1.8 addresses some of these. Personally, I can live without the modern language niceties. I would really, really like type inference though. Oh, and unsigned ints too. |
|
Java does have its own form of type inference that revolves around Generic functions and once you make peace with it, life isn't so bad. Rather than writing
var xyzzy=new ArrayList<Foo>();
you can write
List<Foo> xyzzy=Lists.newArrayList();
Similarly, the lack of first class functions can be worked around by various means. The Guava toolkit contains map/fold and other functional operations, and when worse comes to worse you can write
for(Thing that:things) fn(that);
In cases where you might be tempted to do something that's more verbose than if you tried to do it the cool way.
There is a lot to like about JDK8 but unfortunately I'm coding to JDK6 these days instead of JDK7 because it's a waste of time dealing with trouble tickets caused by people who are running the wrong Java version and don't know what is going on.