4 ms·
Learning C is about learning how the OS works. The C syntax is quite simple. Complexities come when dealing with the OS through system calls. Threads, sockets,
by hnaccountme 3y ago
Learning C is about learning how the OS works.
The C syntax is quite simple. Complexities come when dealing with the OS through system calls. Threads, sockets, memory, etc.
Most other languages are about learning the language features. The languages you have mentioned and C++ are like this. People tend to get bogged down in trying to get the language feature to work for their problem. I have avoided this as much as possible since I find going down that path forces me to restate my problem in a more contained environment.
I work on Linux with C. The two most important books I've used are
1. The C Programming Language by Brian Kernighan and Dennis Ritchie
2. the Linux programming interface by michael kerrisk
Also understanding your compiler and debugger is very useful. There are a lot of options in these tools to improve your program and workflow.
Try to reduce your cycle time. Code, compile and test. Don't try to write a tone of code and they get it to work properly all at once
- kingkongjaffa 3y ago> Learning C is about learning how the OS works. If I just want to write a C program I don’t understand how this is true, can you elaborate?
- P_I_Staker 3y agoI don't necessarily agree with OP. I would point to compiler / toolchain first. Not every program will have syscalls, threads, signals, etc, etc I will say that a huge subset of C programs involve low level interactions. I know some talented developers that feel disagree, but I wouldn't use C otherwise (though there are probably other use cases). ie. basically never In which case you are somewhat of a hardware / kernal / OS programmer. The lower layers will matter. In the PC world this might be abstracted away. I haven't heard of many developers diving into eg. a modern Intel x86, at a hardware level (but perhaps write some ASM). C also works well for embedded systems. In which case you likely have a compiler and have to interact with low level hardware and peripherals. So I will say in the long run you will need to learn these things. My education in C involved writing code for linux system; that's how it's taught to CS/SWE people. On the computer / electric front, you would work with an embedded platform. In either case you'll learn useful things and will be able to jump back and forth... but there will be some substantial differences in your specialized knowledge.