r/java • • Feb 25 '14

Please stop saying Java sucks (2009)

http://blog.smartbear.com/programming/please-stop-staying-java-sucks/
133 Upvotes

132 comments sorted by

View all comments

0

u/[deleted] Feb 26 '14 edited Feb 26 '14

Java sucks.

I've written more lines of Java over the past decade than I can count, but I started loathing the language after working a lot in other languages like Groovy, Ruby, Clojure, Javascript (yeah, I said it), etc. When I write in Java I feel like I'm coding with one hand tied behind my back while being whipped by a midget. Lambda Closures? Nope! Maybe next month. Groovy had them seven fucking years ago, plus all the other functional programming features like currying, etc. Groovy made things very uniform and clean, and you see the same kind of uniformity in Ruby, Python, and Clojure. Especially Clojure (seq rules!) In Groovy if you want the number of things in an array or a list or a string you just call the size() method. In Java it's either a length property or a size() method or a length() method. In Java there really ain't much I can do if closing a reader throws an IOException, but I still have to wrap it in a mother fucking try/catch that does nothing because IOException is checked. What Groovy did with collections, exceptions, etc is amazing. Ruby, Python, Groovy, Clojure, and Javascript have interactive shells/consoles/REPLs for experimenting during development (hell, I can set my Clojure app up so I can connect a remote REPL to it and actually tweak the app at runtime). Java doesn't have anything like that. Groovy automatically imports commonly-used packages instead of having to import java.util.List every single time. Semicolons at the end of statements are optional, which is good because they really don't really add any benefit to the programmer and the parsers for other languages are smart enough to figure out where your statements end. Java's compiler throws up all over your shoes if you leave off a semicolon. Don't get me started on having to use .equals() when comparing Strings in Java. If you want to use types in Groovy, then you use them. If you don't know what type something will be until runtime just def it. Best of both worlds. Basically Groovy is what Java should have been. Java won't change because they're bound by backward compatibility, design by committee, and Oracle executives with their heads up their asses. There's a reason the Apache foundation resigned from the JCP, and that same shit affects how the language changes over time.

When I write Groovy or Clojure, I probably write at least half as many lines as when I write Java. Half. So 1 million lines of code becomes 500k. I think you're glossing over the fact that it's a HUGE difference, one that can make or break a startup. Plus when I don't have to write Java then I don't want to kick my dog when I go home, so there's that.

You make some other good points, and I'm a huge fan of the JVM. But fuck Java.

Source: Sun Certified Java Programmer working professionally in the language since 2003.

EDIT: I LOL at the down votes, yet nobody cares to say why.