3 Mar 2014 rkrishnan   » (Journeyer)

On writing books

Posted on March 2, 2014 by rkrishnan

Off late, I had been reading the Plan9 papers from Bell Labs. The papers prompted me to go back and read some of the books written by the same folks at Bell Labs.1 What is so astonishing is that the books written by these finest engineers are the clearest form of writing about programming that has ever been produced. These books almost never exceed 300 pages. Let me list some of the books here:

  • The C Programming Language, Kernighan and Ritchie.
  • The Unix Programming Environment, Kernighan and Pike.
  • The practice of programming, Kernighan and Pike.
  • Software tools, Kernighan and Plauger
  • C traps and pitfalls, Andrew Koenig
  • The AWK programming language, Aho, Weinberger and Kernighan
  • Elements of programming style, Kernighan and Plauger
  • Programming Pearls, Jon Bentley.
  • More programming pearls, Jon Bentley.
  • Compilers: Principles, Techniques, and Tools, Aho, Sethi and Ullman.
  • The design of the Unix operating system, Maurice J. Bach.

I believe this covers the list related to Unix/C and other related tools. There could be more that I don’t know about.

At the risk of repeating myself, here are the salient features of these writing (and also the Plan9/Unix papers).

  • concise.
  • clear and unambiguous.
  • lots of clean code examples to illustrate the points.
  • wonderful exercises.
  • lots of real life examples.

The AWK book has an example showing a simple implementation of make, in ~5 pages. Tell me any other book that does that.

Why is it that these authors consistently wrote these high quality books and papers? I believe it is because they worked on it first and were genuinely interested in sharing their work with others. They also strived for the highest quality in all their work - be it writing software or writing documentation.

Contrast it with the modern world. Within a few months of a new language or a library or better a “framework” appearing in the Internet, a bunch of books gets announced on Twitter and twitter handles setup to announce the upates of the book. Most of these are written by people with the sole intention of getting more search hits for their names in the popular search engines and have not built anything big and “real world”. Some of these books only discuss very superficial examples and lack exercises and real examples. Some present-day authors like to fill their books with footnotes. If I were interested in history rather than content, I would rather look up elsewhere on the web.

The Bell Labs books were all “Real World” books without attaching “Real World”2 on the titles that some of the current generation books do in order to differentiate themselves from the non-real-world ones. This is a pity and is mostly the author’s fault. In their rush to fame, the poor reader and her money and time has no place!

If you are a potential author, please read at least some of the above listed books and try to emulate them, please, for the sake of computer science!


  1. Reading these papers also prompted me to think how much of an antithesis of Unix, the “modern unices” have become.

  2. I didn’t mean anything bad about “Real World Haskell” or “Real World Ocaml”. They are both fine books written by great authors with lots of experience on the topic and it shows.

Syndicated 2014-03-02 00:00:00 from Ramakrishnan Muthukrishnan

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!