Hacker News new | ask | show | jobs
by Certhas 2916 days ago
Is that really true though? Looking at performance optimizations that people do, understanding C is a minimal part of understanding how computers work. It's sort of a codified fiction masking a much more complex reality.

C ignores the complexities of the cache hierarchy and register allocation and IPC extraction. If I code in a garbage collected language I can ignore one more complexity. But C is closer to Java than to the ALU.

Maybe learning LLVM IR would be more useful than either, as it will me allow to debug/reason about the performance impact of the abstractions of many languages backed by LLVM.

1 comments

For the 25-50% that need it, sure, those would make good third or fourth languages. My point is that Python and C should be the first two, not the only two languages they learn in college. My reason for recommending C is to get an overview of what "writing for the computer" feels like with complex data structures, not memorizing the Intel x86_64 manual. Would you expect 100% of CS students to be prepared to learn cache hierarchy and register allocation in their second year? I know a few CS graduates that somehow didn't manage to learn single a programming language (to fizz-buzz level), even in state universities, not talking about community colleges. I think we should step back and look at what all students need, not only the advanced ones.
Im sorry but if someone graduated with a CS degree and can't write an if-else, the teaching was not the problem. I knew a few people like this, but they had to cheat their way through & do 0 work on team assignments.

Students need curiosity & motivation to get to the fiz buzz level, not a specific intro language

And then there are those that legitimately try really hard but still have difficulty with control flow logic and algorithms in their second year, so this is what they should be taught. You can't just ignore them. Skipping ahead to cache access, instructions, and registers in just their second year leaves them behind. There's tons to learn about programming in two years for even the best students that doesn't require intricate knowledge of the machine. Assembly is just not realistic for the majority of sophomores. Additionally, it would be a disservice to teach languages that don't align with industry attention. C is used perhaps 4 orders of magnitude more than LLVM IR.
I never argued for learning llvm, the comment I replied to mentioned CS grads that could not write fiz buz in ANY language. I would never suggest going 0 to 100 like that