
authoritative reference manual provides a complete description of the C language, the run-time libraries, and a style of C programming that emphasizes correctness, portability, and maintainability. Describing the C language more clearly and in more detail than any other book, authors Samuel P. Harbison and Guy L. Steele Jr. provide in a single manual: Standard C - the ANSI/ISO standard now supported by all new C compilers; Traditional C - common practice for twenty years, with millions of lines of code in use every day and the complete Standard and Traditional C run-time libraries. Thoroughly revised and updated, the Fourth Edition adds two important developments: the ANSI/ISO description has been updated with ISO C Amendment 1 (1994), which adds new facilities for writing portable international programs and each language chapter now discusses C++ compatibility, so you can write C programs that will be maximally portable and reusable in C and C++ environments - an important consideration for software developers.
In college I'd programmed Fortran on punched cards. APL was like dropping acid, and I worked one summer as a commercial APL programmer, but it wasn't appropriate for what I needed. Pascal didn't quite fit either. C was in that context mind-blowing. The future had arrived! I had full access to the machine!
If one is learning to become a plumber, one might not be so interested in how plumbing worked in 1840. If however, one is a herding dog, and needs serious work to avoid getting bored and destructive, reading K&R would put C in historical context.
Later, as I depended on C, I bought each edition of C: A Reference Manual by Harbison and Steele, and read it as if I were studying to be a lawyer.
I now program in Haskell, and wish I was equally versed in Clojure and Rust. If I were returning to C, I'd instead choose Rust. For my work, I have a free choice.
Looking at https://crms.tiiny.site/#Function-Pointers I am glad I do not have to program C anymore..
/\* Declare a function returning char *. */
char *a (char *);
/\* Declare a pointer to a function returning char. */
char (*a) (char *);
/* Declare a pointer to a function returning char *. */
char *(*a) (char \*);
This brings up 20 year old memories of pain. How did I ever remember this?I would recommend:
- The Elements of Style, aka, "the Little book". Made me a credible editor (and documentation writer at the time) almost at zero time.
- Zero to One: in-depth, honest, and non-conformist view of the tech startup landscape. "How Google Works" is a close second.
- The Embedded Systems Dictionary. Not in print but the second-hand paperback is worth it. Great refresher, written with a wit.
Another book I use is "The Developer's Guide to Debugging".
In general I like zero-bullshit or more politely, zero fat books. "The Elements of Style" is one. "The Developer's Guide to Debugging" is also very low in fat, war stories and other nonsense.
There are other books that I like that are less influential.
Aphorism: I don't believe in software books. Exceptions are well-researched reference volumes, e.g., "C: A Reference Manual, 5th edition". I believe in undisputed truths, not in one person's preference or experience over another's.
These days I mostly consult manuals and standard documents. Technical books will only give you that much; see them as a vehicle to learn how to learn. Exceptions are again reference handbooks, that will have to be exhaustive.
I don't believe in trainings, fast, slow or anything. Self-learner here, learned reading by myself around the age of 3 (shocking revelation: have you realized that you can only recall detailed memories only after you have learnt how to read?) Actually it was exactly the winter of 1980 (born 1977). I was a serviceable reader by the coming of sprint 1980 and could read subtitles as fast as the adult is assumed to by early 1981. Educated physicist but self-educated programmer.
1. C: A Reference Manual, by Harbison and Steele. https://www.amazon.com/Reference-Manual-Samuel-P-Harbison/dp...
2. The C Puzzle Book, by Alan Fueur. https://www.amazon.com/Puzzle-Book-Alan-R-Feuer/dp/020160461...
Harbison and Steele has much better explanations than K&R. The Fueur book taught me a lot about C declarations. Declarations are that part of C language that is them most unnecessarily difficult.
You asked about a slightly different question, best practices. But in the real world you'll run into a lot of code that practices below that level.
C has lots of edges where it's easy for a beginner to make mistakes. Say for example the minimal range of a char is -127 to 127 (yes, C cares 1's complement machines) or 0 to 255. Not knowing this may result in a code working in one machine while broken on others. So learning the standard is a must, especially, the undefined behaviors.