Programming in C can turn you into a very disciplined programmer for the simple fact that you will need to track when you request memory and when you need to free it. Essentially you will become the garbage collector. I would recommend you to the read classic "The C Programming Language" (Kernighan & Ritchie) and "Expert C Programming Deep C Secrets" (Van Der Linden) which will get you far enough to write useful programs. I read half of Gustedt book and it has good advice, probably need to pick it up again. A good starting point is to implement your own data structures, like lists, double linked lists, dynamic arrays (had a lot of fun implementing this one). Also (this is personal preference) I would learn a bit of the autotools, they are painful to learn and feel kind of ugly, but once they are in place you basically will forget about a ton of things and your build will become a joy (there's a nice book by No Starch Press about it). I've managed to integrate Check (https://libcheck.github.io/check/) so now I have unit tests in C which is something nice.
I don't recommend learning how to use Autotools unless you need to work on a project that uses it (and even then, try to avoid it).
Highly recommend learning CMake or Meson instead.
If you're just getting started, there's no need to tie yourself into knots learning "how to set up a project the right way". It's a waste of time. Your time would initially be better spent just calling the C compiler directly. This will help you learn a bit about the compilation and linking phase and will expose you to the C compiler's flags---useful skills for debugging automated builds later. Once you get to the point where you are working on a larger project, then you will be in a better position to decide what build tools are most useful for you.
> If you're just getting started, there's no need to tie ...
Yes, this is sane advice! Note that I'm not promoting autotools, I personally suffered it a lot before I got it for my builds, but is a tool that can be reliable across platforms. Yes I would leave the "how to set up a project" for the time when you really need it, no need to spend time on this if you're learning a language.
I have a C project I picked up (and got working thanks to help from HN users) that was heavily dependent on Autotools. I wanted to be able to compile it under Windows and couldn't make heads nor tails of it. After guessing and tweaking a config.h file to replace the one it didn't create, I was finally able to get gcc to compile everything using a batch file.
Eventually I'll be purging Autotools, make and all build systems, replacing it with a single batch file that wipes the slate then compiles. It only takes a few seconds to run, and removes a huge set of dependencies.
I hope to port the code to run under the Cosmopolitan library so I can be cross-platform and more.
I disagree, I find autoconf and automake very pleasant in operation. Mainly due to the OOTB support for things like bindir, libdir, and so on, all properly documented via /path/to/configure --help.
You probably don't need autotools as a beginner but if you intend to study those it makes no point starting with cmake. This is more of a C++ crowd thing with tiny mindshare among C programmers.
I’m also a traditionalist and I think the classic K&R C Programming Language book is the best way to learn C—you also get an understanding why C and *nix-based systems seem to go so well.
I love books, even if I don't finish them, especially the technical ones. Today we're very used to recommend sites and youtube videos as primers for learning. In some situations that is ok but I wouldn't hesitate for even a second if I have to choose been something online or a book.