Live data from Hacker News

My latest anti-java rant

badcheese.com

31–40 of 48 posts

Re: My latest anti-java rant

#31
post #22

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? Al…

I'm the author of the original article. What about bloat? It's hard to compare java to C applications because people don't tend to write the exact same app in more than one language, but compare Azurus to utorrent. Sure, Azurus has many more bells and whistles than utorrent does, but are you willing sacrifice an entire machine's CPU/memory to a single app just to get some special features? I doubt it. utorrent is the…

Somewhat tangentially: I run a useful app, JBidWatch (a nice, free eBay "sniping"/monitoring tool) on my Windows XP desktop. I started it 1 week ago following a reboot. One week later I noticed the PC's mem usage was nearing the amount of physical memory and investigated; one contributor turned out to be the JVM session running this app: according to Task Manager, this app (actively monitoring no items during the week) was consuming over 100M of memory. Now, I won't stop using it, because I'm not aware of a better tool, and restarting it is not particularly painful, and yes, it's likely this app wouldn't exist w/o the ease of programming offered by Java (though I would prefer a GUI-less version written in a language I am fluent in), but still: 100M of memory for a web-polling app that was essentially idling (from an end-user perspective)? I've observed that various JVM apps gravitate to these (to me) giant memory footprints over time; I assume it's "the nature of the beast", but I'm speaking as a programmer who has never written a line of Java. A sysadmin sitting in the next cube, responsible for various Java-based server apps, has simply agreed with me that this is what's expected from Java apps.

Re: My latest anti-java rant

#32
post #30

I think the source of the OP's pain can be traced to the fact that while Java is reasonably competent as a programming language, it's complete and utter crap as an operating system. It replaces the finely honed tools of a modern operating system with it's own inferior versions, the process model is replaced by threads, shared libraries are implemented as "Beans" and come with an impressive armature of support infrast…

Woohoo, sing it, brother! :)

Re: My latest anti-java rant

#33
post #31
post #22

Earlier quoted context omitted.

I'm the author of the original article. What about bloat? It's hard to compare java to C applications because people don't tend to write the exact same app in more than one language, but compare Azurus to utorrent. Sure, Azurus has many more bells and whistles than utorrent does, but are you willing sacrifice an entire machine's CPU/memory to a single app just to get some special features? I doubt it. utorrent is the…

Somewhat tangentially: I run a useful app, JBidWatch (a nice, free eBay "sniping"/monitoring tool) on my Windows XP desktop. I started it 1 week ago following a reboot. One week later I noticed the PC's mem usage was nearing the amount of physical memory and investigated; one contributor turned out to be the JVM session running this app: according to Task Manager, this app (actively monitoring no items during the wee…

See, another fine example of my point. Thanks for that.

Re: My latest anti-java rant

#34
post #21
post #14

Earlier quoted context omitted.

The key words to understand the author are buried in there: "As a sysadmin". For sysadmins, the time saved in development means nothing, while every additional machine (and especially the infrastructure to run them as a cluster) means more work. Still, shouldn't even a sysadmin appreciate the increased reliability and especially security that modern languages bring?

I'm the author of the original article. A typical server costs $1500 (DELL, HP) nowadays, but I've seen java apps commonly take up a whole rack of servers, not just one. This is a base cost of $30k and > $1500/mo for rackspace, A/C, power, bandwidth and maintenance. That's one-half of an FTE up-front and one FTE's salary reoccurring. I hear from java developers, "I'll need 6x 3Ghz, quad-core, dual-cpu machines for th…

That's one-half of an FTE up-front and one FTE's salary reoccurring.

Only if your FTEs are very cheap. Most I know wouldn't get out of bed for less than $50k+.

But even if it was half a man-year upfront and one recurring - that's still a no-brainer (remember we're talking an entire rack here, which goes quite a way for most apps). If that rack enables your 5 programmers to work only 10% faster (completely theoretical ofcourse, but for the sake of the argument...) then it has already more than paid for itself.

Your argument is quite old nowadays (I remember the heated efficiency debates in the 90s) and has long been decided. Hardware is so cheap now that in most cases it really is demonstrably more cost effective to throw hardware at certain problems.

Re: My latest anti-java rant

#35
post #26

In many cases macro-optimization trumps micro-optimization. C/C++ might be closer to the metal and in extremely simple applications incrementally (or perhaps significantly) faster, but if the difficulty of using C for web app development results in an extremely sub-optimal solution then you'd have been better off with a more advanced language like Ruby or even Java. Moreover, the long pole in almost every web applica…

I'm the author of the original post. I agree that I/O is going to be slow in any language, so I agree with you there. However, your point about a single server being equal to the salary of 4 FTEs, in my experience, we're not talking about a single machine. Commonly, we're talking about dozens or racks worth of machines. Now we're not talking pennies anymore. We're talking tens of thousands of dollars. This is wastefu…

Now we're not talking pennies anymore. We're talking tens of thousands of dollars.

Do the math. If 4 devs cost $1500 in a day then "tens of thousands of dollars" is not much in comparison. I think you, like many devs including myself, might be suffering from "big figure anxiety". A $50k investment for a rack looks mighty intimidating at first. But break it down in excel and in most cases you'll find it turns out way cheaper than the alternatives (e.g. hiring a few "C experts" or "spending a month on optimizations").

Re: My latest anti-java rant

#36
post #23

Earlier quoted context omitted.

Exactly, as a sysadmin, he should appreciate, that he is not solving buffer overflows all the time. Regarding the more work, as a sysadmin, it is his job to make the machines run the application. His salary and benefits are part of the cost using the higher level languages/additional computers. His rant could be taken as "lazy sysadmin" problem, while what he is ranting against was just costs/benefits decision.

I'm the author of the original post. Sysadmins don't solve buffer overflows, that's a programmer's job. True, my rant could be takes as a "lazy sysadmin", but I have a CS degree and have a programming background. Personally, I'd prefer to re-write this code myself in C than see this kind of hardware waste. That's not being lazy, it's being respectful of the power at my disposal. Use the machine's power on doing actua…

Sorry, I was inprecise. Of course sysadmins do not solve buffer overflows, they solve what happens when someone exploits one.

I understand what you are saying, you see that the flight to the moon was done by something equivalent to C64 and today we are allow wasting orders of magnitude more computing power.

What I'm trying to tell you, look at the whole picture. There is a cost associated with writing and maintaing software. That hand optimized assembly application is going to be more expensive (and take longer to deliver) than the Java/c#/whatever equivalent. There is another cost associated with purchasing and operating hardware (that includes paying sysadmins, for example). The business has to consider what is more effective, and usually HL language/more HW is the more efficient solution.

What, more efficient, you say? We were talking about wasting the computer power. Yes, more efficient overall. We have a method for measuring wasting resources - money. You are going either waste some money on hardware/electricity/floor space/sysadmins, or programmers/time to deliver/managing larger team/managing recruiting and retaining competent programmers. Not only is the former cheaper, it is also easier to quantify and manage. It is no wonder, that you do not see companies taking the later approach.

At the end, what most people do not understand (not only technical people, but most people) is that successful enterprise is not a 100% efficient one. There is going to be waste, but it must be in the right spot. Actually, conceptually it is similar to profiling, you don't optimize spots that do not matter in the big picture. And computing power does not matter for most business, it is a cheap resource. People, on the other hand, is not.

Re: My latest anti-java rant

#37
post #27
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.

I'm the author of the original post. It's not difficult. Get a good debugger, and you're job is easy. Use a memory allocation tracker while you debug, then switch back when you're done. It's not hard, just takes a little more time. Don't be lazy. Use ccmalloc: No recompilation is needed to use ccmalloc; simply link it with -lccmalloc -ldl or ccmalloc.o -ldl When you've found and fixed your leak, stop linking with the…

> It's not difficult. Get a good debugger, and you're job is easy.

Easy for a sysadmin to say! How many web apps have you written in C lately?

> It's not hard, just takes a little more time

Yeah -- just long enough to go out of business ;)

Re: My latest anti-java rant

#38
post #28

I'd comment on the blog if I didn't have to login. Wins prize for most naive rant this week. There are a lot better reasons to hate on java, but speed really isn't one in 2010. I'd love to see the rewrite of one of the apps he's complaining about in C and blog post about that. --omg-optimized

I'm the author of the original post. Re: login, sorry, it's drupal and I turned off anonymous comments for spam reasons. :) I'm sorry that you think that I'm naive. I'm 41 years old and have a CS degree. I've been a linux programmer and sysadmin since 1993, before linux had a 1.0 kernel (0.99.9.45 or something like that when I installed my first linux machine). My background is in programming and I spent my college c…

>Java is slow

No, it's not. Modern JVMs produce extremely fast code. For numeric calculations, there's essentially no difference in speed between Java and C. (After all, why would there be? The JVM has static type info and is emitting assembly.) This was true even in 2004, so it's really long overdue that you move on from 1995 :)

http://www.idiom.com/~zilla/Computer/javaCbenchmark.html

>If you were to write your code in something more "close to the metal"

C is close to the PDP-11; it's not particularly close to modern hardware.

Re: My latest anti-java rant

#39
post #31
post #22

Earlier quoted context omitted.

I'm the author of the original article. What about bloat? It's hard to compare java to C applications because people don't tend to write the exact same app in more than one language, but compare Azurus to utorrent. Sure, Azurus has many more bells and whistles than utorrent does, but are you willing sacrifice an entire machine's CPU/memory to a single app just to get some special features? I doubt it. utorrent is the…

Somewhat tangentially: I run a useful app, JBidWatch (a nice, free eBay "sniping"/monitoring tool) on my Windows XP desktop. I started it 1 week ago following a reboot. One week later I noticed the PC's mem usage was nearing the amount of physical memory and investigated; one contributor turned out to be the JVM session running this app: according to Task Manager, this app (actively monitoring no items during the wee…

You know, you can set a maximum heap size for JVM processes. It defaults to 1/4th of the physical memory or 1GB, whichever is the smaller.

Re: My latest anti-java rant

#40
post #21
post #14

Earlier quoted context omitted.

The key words to understand the author are buried in there: "As a sysadmin". For sysadmins, the time saved in development means nothing, while every additional machine (and especially the infrastructure to run them as a cluster) means more work. Still, shouldn't even a sysadmin appreciate the increased reliability and especially security that modern languages bring?

I'm the author of the original article. A typical server costs $1500 (DELL, HP) nowadays, but I've seen java apps commonly take up a whole rack of servers, not just one. This is a base cost of $30k and > $1500/mo for rackspace, A/C, power, bandwidth and maintenance. That's one-half of an FTE up-front and one FTE's salary reoccurring. I hear from java developers, "I'll need 6x 3Ghz, quad-core, dual-cpu machines for th…

I've seen java apps commonly take up a whole rack of servers, not just one

Ok, and I've seen Java apps not do that. Argument by anecdote is bankrupt.

Post reply on HN