Why Java Sucks – Jonathan Gardner
&gt; Yet again, they admitted an important feature was missing. Again, I am not familiar with Java 8 but I suspect their implementation is horribly wrong.<p>Admitting something is broken does not mean it sucks. See this comment: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=13216187" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=13216187</a><p>Also, please read this before you wave it off: <a href="http:&#x2F;&#x2F;stackoverflow.com&#x2F;a&#x2F;1073427" rel="nofollow">http:&#x2F;&#x2F;stackoverflow.com&#x2F;a&#x2F;1073427</a><p>&gt; I have. I guess I have just logged more time in Java than others.<p>Java is probably my most used language and that&#x27;s saying something as I work as a TA for a Python class, use python for most personal projects, and also use many other languages. Java consumes the most time because it has the most polished toolings and standards for developers. Now they may not always be ovserved but if you stay in your own walled garden everything is all honky-dory.<p>You will never make these mistakes if you follow basic practices in Java&#x27;s naming conventions. All lower case classpaths, all uppercase class names, lower then cammel function names, etc. You&#x27;ll never be able to mistake Test() for Test.test() as they are instinctivly different names.<p>&gt; Please tell me how to do it properly. IE, if I have a variable of type Foo that is holding a value of type Bar, how do I invoke the function with Bar instead of Foo in the signature?<p><pre><code>    void something(Foo f) {
        if (f instanceof Bar) {
            (Bar-Specific commands)
        }
        (generic commands)
    }
</code></pre>
Or better yet use your magic want: <i>Abstraction</i>. Wave it around and use your super powers to move that functionality into Foo and in anything that needs a specific handling of that function, override that.<p>&gt; My point exactly. Other languages just use globals. Because they are useful and people need them. Java makes you invent a new programming paradigm to overcome its artificial limitations.<p>Well if you want to resort to global constants you can. Use a static import. LWJGL makes heavy use of this anthough I dislike it. I&#x27;d rather have an abstract interface into the library rather then have a global constant.<p>&gt; And what do you do when you blow out the 80-char limit on columns? Oh let me guess. You like your 1024-char limit on columns because you are using a superior IDE.<p>Yes very much so. Please see this: <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=wf-BqAjZb8M" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=wf-BqAjZb8M</a><p>Line length != good code. Now granted, that doesn&#x27;t mean run wild but I do have some code written that is perfectly good code, I&#x27;ve just ended up using some long variable names. This happens in Python as well. And no, you don&#x27;t need an IDE for this, I write most of my prototype Python in nano before moving it into an IDE as Python IDEs are extremely sub-par.<p>&gt; I don&#x27;t recall that being an option. I do know that people used to prefer the curly brace format but that turned out to cause memory leaks.<p>I don&#x27;t remember `new int[] {};` causing memory leaks but yes you can even do a static import to do the following: `asList(1, 2, 3, 4)`.<p>&gt; The issue with inner classes is that so many thing are contrary to expectations. I started to list them all but it got too long. I&#x27;ll have to revisit it and try to condense it down.<p>I&#x27;d love to hear it, and I&#x27;d love to define a set of &quot;sane&quot; sub-features of sub-classing in Java. I&#x27;ve working with libraries that where HORRIBLY written that have used sub-classes and I&#x27;ve also worked with amazing ones.<p>&gt; The point is the reason why they do it is because it&#x27;s easier to write, test and debug these other languages than Java. People know that coding in native Java is slow and cumbersome and time-consuming with no significant benefit.<p>I don&#x27;t think this is the case. Enterprise Java came about because design patterns, like viruses, spread through code bases. You should look at this: <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=JxAXlJEmNMg" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=JxAXlJEmNMg</a><p>David goes through the history of development and I find it enlightening. He mentions it VERY breifly but many government contractors and researchers ended up using XML a lot. It came from another standard that they developed. As such, it was easier for them to write XML templating.<p>Then again this isn&#x27;t a bad thing for two reasons:<p><pre><code>    1. Someone else being bad at writing Java doesn&#x27;t mean Java is bad.
    2. Sometimes XML is the correct way to do things. Do you write ALL of your web pages in Javascript adding elements in with document.createNode....()? No you use an XML notation. 
</code></pre>
Java has gotten out of hand with XML because monkey-see-money-do but that doesn&#x27;t mean the language is bad. I blanket refuse to use XML-requiring libraries. I just right my own implementation if it&#x27;s required. I&#x27;ve done it for a game I&#x27;m working on. I&#x27;ve tossed all UI libraries as they all need XML and I think it&#x27;s a waste of my time. I can write the library, and then use the library faster then I can read all the documentation about writing their stupid XML format.<p>&gt; What claims need numbers? LLVM and PyPy exist. JS with JIT kicks the pants off of almost everything --- because it is compiled down to native machine code. Go look them up for yourself. JIT is the new fad, and it&#x27;s a huge deal.<p>I&#x27;ve worked a lot with NodeJS, I&#x27;ve worked a lot with LLVM, and I&#x27;m about to do a lot of work with libdill (you&#x27;d like it if you&#x27;ve not seen it). I love lazy evaluated, JITed, and optimized languages. Runtime or no. That&#x27;s why I love Java.<p>Java, especially after Jigsaw, will have major opprotunities to blow other languages out of the water. Java is great in runtime performance but horrible in startup performance. For server applications you can&#x27;t get much better.<p>&gt; Name one.<p><a href="http:&#x2F;&#x2F;www.dnsjava.org&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.dnsjava.org&#x2F;</a><p>I think Commons has one but I like this better as it&#x27;s not-Commons. In my book that&#x27;s a feature.<p>&gt; I write code to get the job done so I can get paid, my company&#x27;s stock price can go up, and I can get money. It&#x27;s a job. Yes, I love programming, but I prefer to get as much done with as little work as possible.
&gt; Yeah, you strike me as someone who only knows Java. Let me know if I&#x27;m wrong.<p>My resume includes Python, JavaScript, C++ (now), C, Java, PHP, X86&#x2F;ARM Assembly, LISP-Like languages and a few other things that I&#x27;m not remembering off the top of my head. I&#x27;ve got one project coming up in Go as well. This is in order of most-recent-project. Today I wrote something that will search craigslist and ebay for a x220t with an I7 and email me all of the results under $200. I&#x27;m looking for one and I&#x27;m in college so I&#x27;ll just wait it out for the price to be right. Anyway, that was a Python project.<p>I also TA for a Python class at my university which I&#x27;ve successfully shot down trick questions from that one way-too-smart student that we all were once a time (He tried to tell the prof to use xrange instead of range for a performance boost and I had to bud in and say &quot;xrange was removed&quot; since he was stuck in the land of Python 2). I&#x27;ve also ported over Python code bases from 2 to 3. I mention Python so much because it seems as if you&#x27;re a fan.<p>I hope that well establishes my programmer-cred.<p>&gt;Let me change your example:<p><pre><code>   class Test {
   	private final int i;
   	public Test(int i) {
   		this.i = i;
   	}
   	public Test() {
                this.test(7);
   		this(10);
   	}
   
   	private void test(long number) {}
   }
</code></pre>
This is the best behavior to have. If you haven&#x27;t initialized the state of a class you shouldn&#x27;t acess it&#x27;s methods. I&#x27;d rather have this rather then have an uncertianty about the contents of uninitialized state.