5 ms·
My main problem with Java isn't the language itself. I think it's a pretty ok language as far as statically typed ones go. My problem with Java is the way it's
by rb2k_ 16y ago
My main problem with Java isn't the language itself. I think it's a pretty ok language as far as statically typed ones go.
My problem with Java is the way it's currently being used. E.g. using annotations to fix things that the language won't let you do elegantly.
There's a lot of horrible overengineering for relatively simple problems (you don't HAVE to use GOF patterns, they're just a suggestion for a solution. If you don't have the problem, don't use the solution!).
While there are a few nice libraries (e.g. http://jsoup.org/ http://jsoup.org/ ), even those usually don't have examples. Especially when you don't know the library yet, it's wonderful to get a few minimalist examples how to use it. Just compare:
Java: http://jsoup.org/ http://jsoup.org/
Ruby: https://github.com/hpricot/hpricot/wiki/ https://github.com/hpricot/hpricot/wiki/ or http://nokogiri.org/ http://nokogiri.org/
While both Ruby HTML parsers have a simple example right on the starting page, I have to make at least 6-7 targeted clicks for Jsoup.
The same even goes for the core libraries. Just look at Ruby's String class:
http://www.ruby-doc.org/core/classes/String.html http://www.ruby-doc.org/core/classes/String.html
And then look at Java's String class:
http://download.oracle.com/javase/6/docs/api/java/lang/String.html http://download.oracle.com/javase/6/docs/api/java/lang/Strin...
In Ruby, almost any method has a small example. The Java doc only has an example for the constructor...
- Nitramp 16y agoMy main problem with Java isn't the language itself. [...] My problem with Java is the way it's currently being used. Absolutely agreed. Java has some weak spots, but the really bad things (and the most criticized things) are not in the language per se. E.g. the complete over- and abuse of XML for anything. Complex Ant build scripts. The whole EJB disaster (the older versions, that is). Bad APIs (though in all honesty, most of the really bad ones are 3rd party and not from Sun). The over-use of dependency injection, beans, etc. without a justifiable reason. Many of these things are just stuff we learned to do better by now, for example JSON and/or Yaml over XML configuration, and convention over configuration. That lower overhead and higher understandability are more important than some would be architect's dreams. On some things the jury is still out (e.g. more or less functionality in basic classes like String, List, ...). Overall, I think some people are overlooking the many benefits Java has made available to the main stream. It's entirely possible to write beautiful Java code, you just have to go the extra mile of leaving the convention sometimes.
- sigzero 16y ago"My problem with Java is the way it's currently being used" That is a good point. However, comparing the way things are done in Java and they way things are done in Ruby is a really bad comparison. Those languages live in different problem domains and were grown to solve totally different problems.
- _m_h 16y agoWhat problem domains are you refering to? I can think of some quite similar ones..
- regularfry 16y agoAs the article points out, Java itself isn't most popular in the niches it was supposed to fill. I don't think it's really appropriate to talk of what they were grown to solve. What they are actually used for is far more illuminating, and while Ruby is encroaching more and more on Java's "home turf," especially now that JRuby has the momentum and capability it has, you can't really say the same the other way.
- merijnv 16y ago> My main problem with Java isn't the language itself. I think it's a pretty ok language as far as statically typed ones go. Really? Which statically typed languages have you written in? I think Java (together with C and C++, lets not let Java take all the blame here) is pretty much the bottom of the barrel as far as statically typed languages go. Compare some of the type examples in the threads here with Haskell's type system... (Is this post meaningless functional programming propaganda? Probably. But for the love of god stop the myth that Java/C/C++ are good examples of static typing...)
- regularfry 16y agoIt says something when Ruby's notoriously shonky documentation is the paragon in an example like this. The comparison with, say Python, is even more illuminating.
- rb2k_ 16y agoI might be wrong, but in the case of String, not really: http://docs.python.org/release/2.5.2/lib/string-methods.html http://docs.python.org/release/2.5.2/lib/string-methods.html
- regularfry 16y agoThere's also http://docs.python.org/tutorial/introduction.html#strings http://docs.python.org/tutorial/introduction.html#strings, http://docs.python.org/library/string.html http://docs.python.org/library/string.html and http://docs.python.org/library/stdtypes.html#sequence-types-str-unicode-list-tuple-bytearray-buffer-xrange http://docs.python.org/library/stdtypes.html#sequence-types-.... There's a fair bit of duplication in there, yes, but I think it's a pretty good coverage overall. There are some absolute doozies in the Ruby documentation, particularly around IO and the Socket hierarchy. String is relatively ok.