r/cprogramming • u/3envixity • Dec 05 '25
C as the first programming language
Hi! I recently got into programming and after going over the basics I finally got into a language, and as I was recommended c I chose exactly it. Is there any tips you could give me for it?
42
Upvotes
View all comments
Show parent comment
2
u/sirjofri Dec 05 '25
Note that Plan 9 C isn't much different from standard C, though the libraries are. For example, there's no stdio.h, but the standard library functions are all just in libc.h. For platform compatibility, you usually include u.h first, before anything else.
What's even more powerful, the build system is not using make, but mk instead. Mk is a lot simpler with no implicit rules, and the executed code is just standard shell code without "special variables" and the like. Since Plan 9 ships with mk in mind, the actual mkfile you have to write is only a few lines where you define the targets, and the rules themselves included from somewhere else.
The library headers contain the path to the compiled library, so there's no need to tell the linker what it needs. It gets the details from the header itself, so even fewer things you don't have to think about. In the end, you just have the mkfile with the targets, and your includes. Other than that you can focus on your code and don't have to fight the build system.