K&R . . . check!

Study of King DavidSource Code:  Kernighan and Ritchie The C Programming Language Code Examples

I’m happy to say that I finally completed my effort to work all the exercises in the classic “The C Programming Language” book by Brian Kernigham and Dennis Ritchie (co-creator of UNIX). What started as a side effort to reinforce pointers and memory management as part of my efforts to write a Scheme interpreter supporting my efforts to work through another classic “The Structure and Interpretation of Computer Programs” turned into an eight month effort (mainly due to my lack of time for side projects).

The effort did reinforce that the C programming language is certainly the king of procedural computer languages. There is nothing a von Neumann architecture computer can do that cannot be programmed by ‘C’ and converted into machine code by a good compiler. However, this king is an old king. Yes, garbage collection, object-orientation, concurrency, and JSON encoding can all be done using ‘C’ from either scratch or via open source libraries. Yet, I’m concluding that the effort outweighs the gain when languages such as ‘Go’ and ‘Rust’ coming into their own.

I have mixed emotions. I’m overjoyed to have re-mastered this language using one of the most classic programing language books to do it. But, overall I would put this effort down as a “failed experiment” from which I have learned that I probably need to look to a more modern language (I’m going down the ‘Go’ route) to fill my needs for a “get the job done with no BS” general-purpose language.

All that said, I can confirm “The C Programming Language” is a truly great book. This single book takes the reader through all aspects of classic ‘C’ (it has not been updated to the latest language standards). In the process it also works through basic implementations of classic algorithms and data structures: arrays, queues, linked lists, hash tables, binary trees, binary search, shuffle sort, quick sort, and a simple recursive decent parser. The book also covers implementations of basic standard library functions using low-level operating system calls. By the end of the book, you will have completed a tour de force of the basics of this classic language. I still highly recommend this book to any developer serious about their craft.

Here is a link to my exercise solutions: Kernighan and Ritchie The C Programming Language Code Examples