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

As I think about teaching my son programming, I think I would start with C and assembly because although it’s super low level, it gives you a fundamental understanding of how the machine works. The debugging and problem solving skills these languages impart will also be invaluable.


Honestly, I don't think C is a good match for "how the machine works".

If you look at the assembler an optimising compiler produces from C, it can take hours to learn how to map the C to the assembler. Also, all the business with "undefined behaviour" (which they will hit soon, and often) isn't how computers work either -- assembler has (very little) undefined behaviour, if you write to a random memory location it is written to (unlike in C where maybe it is, maybe it isn't).

My recommendation would be to teach them whatever is the quickest way to something they enjoy, wether that be Python, Minecraft, Roblox, Javascript for web dev, or C if they (for some reason) really want to start by doing kernel programming or something like that.

You can learn all the "fine details" later, they have a lifetime to do it :)


>... it gives you a fundamental understanding of how the machine works.

ISO/GNU C is unfit for programming classes of devices as ubiquitous as smartphones, or virtually any type of SoC. There is a reason CUDA/OpenCL/ROCm/SYCL exist and why they can't be programmed like usual C if you want performance.




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

Search: