Hacker News new | ask | show | jobs
by mechanicker 896 days ago
This is my exact concern when new corp of developers try and learn operating systems using languages further away from the building blocks.

Unpopular opinion: It is still good to learn enough C + system programming & their gotchas before starting with a more fancy higher level language.

5 comments

I don't think this is a fair comparison. If you want to teach that you can write(2) to raw FDs in Rust, you can, just like you can use write(2) or fprintf(3) in C.

C has a standard library which students should understand even though it's making system calls deep down. Rust has a standard library which students should understand even though it's making system calls deep down (in fact, sometimes through the host C library).

I certainly see the value in knowing C and Unix and that was my education over two decades ago as well. But I also watched many people quit computer science altogether because they struggled with heisenbugs with C pointers. If they could have been kept on track by Rust compiler errors and higher level abstractions, maybe they would still be in the industry today, learning whatever else they needed instead of quitting in their first semester.

Is going from high level to low level somehow worse?

I went from very high level (C# web and even webassembly) to C

and while I believe I learned a lot and my understanding of computers improved,

then I think the biggest lesson is that one of the most important programming ecosystems (C) is a very messy and painful.

Not because it must be painful, but because of decisions made decades ago, maybe some inertia, maybe backward compatibility, maybe culture, who knows?

Low quality compiler messages, ecosystem fragmentation, terrible standard lib (where are my basic datastructures), memory management being minefield, etc.

C gets a bad wrap because there are now alternatives built by finding solutions to problems we only know because of Cs existence. Compiler messages, standard library and memory management are all things we can agree are terrible now days but when C came out it was a huge improvement over the norms before. Also it’s important to remember even “big” things like Unix were at one point just a few thousand lines of code.
> Unpopular opinion: It is still good to learn enough C + system programming & their gotchas before starting with a more fancy higher level language.

And easier

Rust full-timer with a background in C/C++, lately using neither at all. That opinion isn't as unpopular as you'd think.
After being a web developer for 10+ years, I'm getting into C for the first time. I'd had a bit of experience with Objective-C years ago when I did some iOS work, but that was the "lowest" I'd gone down the stack.

There's a lot of unfamiliar territory, but I'm really enjoying it. When it's complex, it feels like it's just inherently complex. Which is a breath of fresh air for a web developer. I'd gotten so sick of the bullshit complexity that comes along with the high-level work; programming feels fun again.