27 ms·
“The C Programming Language, Second Edition” is an excellent book for learning the basics of ANSI C. However, there have been a few revisions of the C standard
by linguae 4y ago
“The C Programming Language, Second Edition” is an excellent book for learning the basics of ANSI C. However, there have been a few revisions of the C standard since then. While none of the changes are extreme (it’s not like learning Java 1.2 or Python 2 in 2023, and there are many ANSI C code bases still being maintained today), it’s still good to know of the newer features of the language. Additionally, the book does not cover certain pitfalls that affect the security and reliability of programs written in C, such as security problems caused by faulty uses of gets() and strcpy().
It’s unfortunate Dennis Ritchie is no longer with us; it would be nice to have a third edition of K&R that covers modern C standards and has information about best practices for avoiding situations that can lead to insecure code.
- _448 4y agoThere is one free book for modern C https://gustedt.gitlabpages.inria.fr/modern-c https://gustedt.gitlabpages.inria.fr/modern-c Did not check whether it covers security issues.
- 1letterunixname 4y agoThe "Downloads" link is dead but the other 2 work.
- 1letterunixname 4y agoIn general, following a combined approach of OpenBSD and MISRA is generally a good way to code. Code defensively, check all external untrusted input (Windows (NT-kernel) has checked and unchecked syscalls).
- shric 4y agoI would highly recommend C Programming: A Modern Approach by K.N. King as an alternative and replacement for K&R. http://knking.com/books/c2/index.html http://knking.com/books/c2/index.html