Well, GNU/linux is more "C plus GCC" than pure C. There are a lot of fancy things that GCC gives you that you'd otherwise have to do explicitly.
Ask HN: Learn C in 2023?
21–30 of 220 posts
Re: Ask HN: Learn C in 2023?
#22The C programming language book.
It's really out of date. It doesn't cover subsequent C standards; and it doesn't cover any of the best practices that have subsequently evolved to protect us from the things in C that are deeply awful (in retrospect) in the original. Or any of the evolved practical lore for writing good, portable, safe C code.
Re: Ask HN: Learn C in 2023?
#23I like firearms as an analogy here. Rust is like a modern rifle, unloaded, with six safeties and three locked triggers in a gun safe. The ammunition will harmlessly self-destruct if you don’t focus properly before firing. C is sort of like Rust except the rifle is on the couch, loaded, one in the chamber, all the safeties are off, the numerous open triggers are held by RNGs, and the business end is pointed right at y…
There are other things people like to talk about like automatic memory management and package management and again I'm not convinced these really improve much. The pain of allocating memory in C means people often find ways to avoid doing it altogether which results in much more predictable behavior. Same with pulling in third party libraries. It's rare using more than a couple is actually beneficial but when the package manager is there the temptation is way too much for most people and the result is both unpleasant and very vulnerable to supply chain attacks.
I'm still not convinced any of this is the improvement people think it is.
Re: Ask HN: Learn C in 2023?
#24Write a CHIP-8 emulator in C! In my opinion it’s a perfect project because: - it is a good size. You can be done in 10-20 hours, or longer if that’s your pace (have fun!) - a lot of examples and community support. - you have a whole project without any overwhelming complexities: you’re just taking inputs, reading some data, running it through a switch statement, writing data, writing to a screen, then repeating. - yo…
RIP me who has spent 3 weeks on this
Great project for sure though!
Re: Ask HN: Learn C in 2023?
#25https://www.learn-c.org/ If you have lots of time: https://hal.inria.fr/hal-02383654 If you can't be bothered reading a whole book: https://matt.sh/howto-c Exercises: https://www.codestepbystep.com/problem/list/c and https://exercism.org/tracks/c Once you have syntax and basic algorithms down well, watch this, the only 2 hour YouTube video I'll ever recommend: https://m.youtube.com/watch?v=443UNeGrFoM Both r/cprogram…
Re: Ask HN: Learn C in 2023?
#26Re: Ask HN: Learn C in 2023?
#27Re: Ask HN: Learn C in 2023?
#28Well, GNU/linux is more "C plus GCC" than pure C. There are a lot of fancy things that GCC gives you that you'd otherwise have to do explicitly.
I don't think I've ever seen this criticism leveled elsewhere. Do people criticize JavaScript programming because the ECMAScript standard doesn't give you everything you could want?
Re: Ask HN: Learn C in 2023?
#29Write a CHIP-8 emulator in C! In my opinion it’s a perfect project because: - it is a good size. You can be done in 10-20 hours, or longer if that’s your pace (have fun!) - a lot of examples and community support. - you have a whole project without any overwhelming complexities: you’re just taking inputs, reading some data, running it through a switch statement, writing data, writing to a screen, then repeating. - yo…
“can be done in a weekend” RIP me who has spent 3 weeks on this Great project for sure though!
Re: Ask HN: Learn C in 2023?
#30I like firearms as an analogy here. Rust is like a modern rifle, unloaded, with six safeties and three locked triggers in a gun safe. The ammunition will harmlessly self-destruct if you don’t focus properly before firing. C is sort of like Rust except the rifle is on the couch, loaded, one in the chamber, all the safeties are off, the numerous open triggers are held by RNGs, and the business end is pointed right at y…
Meh. People love to hate on C but the invariants you have to keep track of are relatively simple (things like 0 Some languages like Rust and Haskell do a little better by having the compiler keep track of most of them (if you use it right) but the consequence of misunderstanding them here is accidentally coding yourself into a corner which is extremely unpleasant. There are other things people like to talk about like…
> Most languages replace these with multi-dimensional string based hashmaps that have much more complex invariants to keep track of and similar consequences for failing to do so.
This take reflects a profound ignorance of the relative severity of different kinds of software defect.
When you get an array bound wrong in Java or Rust, you get an exception or a panic. Your program exits and restarts. You get a ticket for fixing the bug. Life goes on.
When you get an array bound wrong in C, you open the door for a nefarious actor to gain control over everything that your program can access.
These aren't similar consequences. They're not even on the same planet of consequences. C apologists are like apologists for asbestos and lead paint.