Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Agreed, The example the author uses in his previous post on the topic talks about cache-unaware code but it's perfectly possible to write cache-unaware code in machine language as well.

I'd say "C is not how the computer works ... but it's much, much closer than nearly every other language."



I feel your statement is actually much closer to the danger. C is pretty close to the hardware indeed and that misleads people into thinking that C is actually exactly how the hardware works. It's a very easy trap to fall into and I've seen many colleagues do just that.


M............................................C

M..............................................Java

Look. C is much closer to how the machine (M) works.


Java’s GC and lack of pointer arithmetic should push it a little further to the right, no?


I don't see why it would. Given what modern CPUs do to make memory fast and safe, pointer arithmetic is a ridiculous simplification that has no bearing in reality.


Give that Java is written in C++ which is in turn an extended version of C, I'm not sure that chart is entirely to scale.


That is no argument in this discussion, IMHO - what does it change? The discussion is about the language (and in case of Java, the runtime) and it's machine abstraction, which is nearly the same for Java and C, even if JVM was written in Lisp.


> Java is written in C++.

I think you're talking about the JVM. Anyway, some processors have native support:

https://en.wikipedia.org/wiki/Jazelle


Jazelle is very dead, FWIW.


So no disrespect to your colleagues, but they work in C and don't understand the relationships between C --> ASM --> Machine Code --> Hardware?

That's... disturbing. Hope they're not building medical devices.


My point was that many people who just now come into C fall into the trap of thinking that it [almost] exactly mimics hardware. Which is an easy mistake to make if you are new to the thing because it's taught as if it's a panacea and sadly many people believe those university courses.

As for former colleagues, oh well, we all learn and grow. I chose to bail out because something as non-deterministic as a C's code stability when cross-compiled for anything more than two systems turned me off. Different strokes, different people.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: