Live data from Hacker News

My latest anti-java rant

badcheese.com

1–10 of 48 posts

Re: My latest anti-java rant

#2
"It’s not as slow as it used to be, but it’s still pretty un-optimized. It doesn’t run “close to the metal” like C and assembly does."

While everyone likes to have efficiency, being readable and/or easy to use sometimes trumps it. Would you really write a program like in assembly, just because it would be faster?

Re: My latest anti-java rant

#3
It's weird to criticize Java for being slow. These days it's pretty much As Fast as C, unless you have a huge amount to gain from unboxed arrays of non-primitive types, or manual memory management. (Possible, but not terribly likely.)

Re: My latest anti-java rant

#4
The JVM has never been 1000x slower than native code. Fourteen years ago it was occasionally as much as 10x slower. What's the penalty these days, maybe 10%? And in return we don't risk undefined behavior if anyone who worked on the project ever made a single mistake? Java is a mediocre language at best, it truly epitomizes everything pg said about Blub, but I'm still glad we didn't use C.

And assembly? Seriously? All but the tiniest processors are superscalar now, and the performance of code depends on obscure details about how instruction scheduling fits into pipelines. The way I hear it, there are only a handful of people in the world who can actually do that better than their compiler, and I'm not going to become one of them. There are too many other things to learn that I can keep using over more time.

Re: My latest anti-java rant

#5
The anti-GC part of this rant is especially hard to take. I've had the misfortune of having to debug various memory allocation problems in C. That's something I don't miss at all. To bag GC for performance without mentioning reliability is just wrong.

Re: My latest anti-java rant

#6
This isn't really an inspiring criticism of Java. There are far better reasons to dislike Java than that it's not C.

Here is a decent reddit thread discussing why people don't like Java: http://www.reddit.com/r/programming/comments/9dzpu/ask_reddi.... The most succint answer just links this: http://ws.apache.org/xmlrpc/apidocs/org/apache/xmlrpc/server...

Re: My latest anti-java rant

#7
post #5

The anti-GC part of this rant is especially hard to take. I've had the misfortune of having to debug various memory allocation problems in C. That's something I don't miss at all. To bag GC for performance without mentioning reliability is just wrong.

The weird thing is how many projects resort to reference counting, which is just like GC only far more expensive (now every single p1=p2 requires two checks for null, an atomic increment and decrement, and a conditional branch around a dtor call!) and less reliable.

Re: My latest anti-java rant

#8
I can't really tell if the author is joking (it reads a little sarcastically), but assuming he's not, the counter argument is really easy. While you're spending days writing mallocs and copying function pointers in C, your competitor is using one of these "lazy programmers" languages and implementing features in hours. Features that are going to take you days to write. Once scale is needed, your competitor just goes out and spends $700 on a cheap server and matches your performance. Ultimately it comes down to time vs. money. It sounds like the author still thinks all computers cost hundreds of thousands of dollars.

Re: My latest anti-java rant

#9
Rather strange rant. I hope it was trying to be funny, but if so, it failed miserably.

Anyway, what I find interesting is that Java really is very slow in one thing: startup time. My completely unscientific test concluded that a hello world -program in written in Java takes about 0.110 seconds to run, while the C version took about 0.003 seconds. What's interesting, Python version takes about 0.015 seconds, which includes parsing, compiling to bytecode and interpreting it, while the Java version has already been parsed and compiled. I would like to know what explains this almost tenfold difference between Java and Python startup times. I suspect it might have to do with the security features of Java?

Re: My latest anti-java rant

#10
post #5

The anti-GC part of this rant is especially hard to take. I've had the misfortune of having to debug various memory allocation problems in C. That's something I don't miss at all. To bag GC for performance without mentioning reliability is just wrong.

The weird thing is how many projects resort to reference counting, which is just like GC only far more expensive (now every single p1=p2 requires two checks for null, an atomic increment and decrement, and a conditional branch around a dtor call!) and less reliable.

Also, reference counting can't handle cyclic structures gracefully. Just say no to it.
Post reply on HN