3 ms·
If reading code is your problem rather than writing code, I find that Java excels. Most of the complaints are about writing code in Java. You know how awesome
by jbooth 15y ago
If reading code is your problem rather than writing code, I find that Java excels. Most of the complaints are about writing code in Java.
You know how awesome that type inference is in Scala, and how stupid and annoying it is in Java to type stuff like Map<K,V> myMap = new HashMap<K,V>? I totally agree with how annoying that is. Here's a related example in scala.
def myThing = something.getSomeThing()
What is the type of myThing?
Java has weaknesses for sure but reading code is actually one of its strengths, precisely because of the boilerplate. Note that I'm not defending EJB or any other atrocities here, just the core language.
Lastly, I agree that syntactically-nicer closures would be better for Java. But it already has closures,
final Something variableImClosingAround;
Runnable myClosure = new Runnable() { public void run() { variableImClosingAround.doSomething(); }};
exec.submit(myClosure);
- anonymoushn 15y agoNow assign to the closed-over value :)
- soc88 15y agoThis comment with all its hand-waving reads like it comes straight from 1990.
- jbooth 15y agoHand-waving? There's code in my comment. No code in yours.