Bookshelf Classic: The Design and Evolution of C++

Stroustrup
There was a time when I put a corporate seal on my favorite books.  Dr. Stroustrup noticed the embossed seal, ran his fingers over it, and remarked "nice" as he signed my copy.

The book was  published circa 1994, and Stroustrup was on hand to give a talk to an eager C++ user group.

While the book describes the early evolution of C++ -- the proposals, the decisions, the trade-offs, and the mistakes -- it is in the early sections where we learn most about the author.  Stroustrup writes:

"It is often claimed that the structure of a system reflects the structure of the organization that created it.  Within reason, I subscribe to that idea."

In my years of programming and working with management, I have found this to be very true.  This was Stroustrup's way of saying the C++ language is largely shaped by who he is.  While it's no surprise he has advanced degrees in mathematics and computer science, we learn that his hobbies include history and philosophy.  Describing Kierkegaard as appealing and Hegel as grandiose, Stroustrup steered C++ toward the individual and the practical, and away from the abstract and the ideal.

"Many C++ design decisions have their roots in my dislike for forcing people to do things in some particular way."

And sure enough, when a member of the audience raised his hand and proposed a particular feature for the language, Stroustrup recommended it be implemented in a library.

It has been a long time since I last opened this book, and I rediscovered a yellow sticky note on Chapter 8: Libraries.  Recalling the moment, I had sought guidance in creating a library to encapsulate threading.  Stroustrup led with a quote from Kierkegaard:

"Life can only be understood backwards, but it must be lived forwards."

I didn't fully understand then, but it meant I couldn't completely know what I needed from a pthread library until after I had written it.  And that it follows I would have to return to it and rework it.

I am happy to say that I did produce a pthread library for Unix which was published in Doctor Dobb's Source Book July/August 1995:




In addition, I reworked the library to support the Windows NT threading model which appeared in Dr. Dobb's Journal December 1996:




Given that "TDE of C++" is from 1994 while the current C++ standard is from 2014, it can't, in a manner of speaking, make you a better language lawyer.  It can, however, make you a better judge. By providing some history and context surrounding C++, the book can make you a more thoughtful, more insightful, programmer.



Update 10/25/19: My thread articles and source code are no longer available at the DDJ website, so I have deleted the links.  For posterity, I have posted copies of the first page of each article instead.

Comments

Popular posts from this blog

MR2 Check Engine

Bookshelf: UNIX A History and a Memoir

Bookshelf Classic: The C Programming Language