Ask HN: Learn C in 2023?
11–20 of 220 posts
Re: Ask HN: Learn C in 2023?
#12Re: Ask HN: Learn C in 2023?
#13I suggest downloading and playing with Raylib[1]. It's written in C, not C++, and is a library for video games, but it can be used to produce apps too. It has a ton of examples for you to review and modify as you learn, and it is cross platform. There are even bindings to other languages if you decide to leave C and use your favorite language. It's a one-click download and setup. Couldn't be easier and more fun! [1]…
Re: Ask HN: Learn C in 2023?
#14In 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.
- you have lots of “test code” aka games.
- it mostly lacks tedium: you’re not repeating ideas too often
- it’s fun!
Re: Ask HN: Learn C in 2023?
#15Re: Ask HN: Learn C in 2023?
#16Also look at C programs. I study old, small unix programs like "more".
I must also say that I see people asking about learning C on sites like Stack Overflow and getting discouraged saying that it's outdated and all. These people are doing a great disservice.
Re: Ask HN: Learn C in 2023?
#17Rust 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 your most prized possession.
It is fun, in a way. Use it in an environment that you don’t care too much about.
Re: Ask HN: Learn C in 2023?
#18https://www.youtube.com/watch?v=QpAhX-gsHMs
I think the best thing you can do is go find a unit testing library you like the look of, maybe some tools for address/leak sanitization, and spend a good amount of time learning CMake and creating a build/project workflow you're happy with. Coming from Rust you've got great tooling and good guardrails in place to keep you on the happy path, I think getting into that groove early in C where you can run experiments and break things in a sane environment is important.
Re: Ask HN: Learn C in 2023?
#19There are tons of useful/fun things you could do with C. Write some desktop apps with GTK, a web server with Mongoose (https://mongoose.ws), etc.
Re: Ask HN: Learn C in 2023?
#20Well, 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.