Hacker News new | ask | show | jobs
by tachyoff 3026 days ago
You can't say "wow, look how much smaller the C program is" and then ignore why it's so much smaller in the first place (no runtime, no garbage collection, etc.) If that's the case, then we should hand-roll assembly all the time because it's "smaller". You also can't just call Java inefficient because it produces larger programs or is "slower". It's all about choosing the right tool for the job.
1 comments

Perhaps Java should have been designed to scale down and not require all that stuff when perfectly reasonable applications don't need them all the time.
Then those "perfectly reasonable" applications are free to eschew languages like Java. People do it all the time to great success. People also use Java to great success. But that's neither here nor there. My point is that it's unfair to call Java programs bloated when the extra space is necessary to support the runtime environment that makes Java Java. I'm not arguing the merits of such a thing (indeed, swap Java with literally any other language), I just want it to be clear that C and Java programs run differently, and both languages/runtimes, such as they are, were developed at different times and to serve different purposes, and therefore it's not correct to bemoan that Java programs are larger. That's like complaining that JavaScript doesn't give you direct memory access or that assembly doesn't have classes.