April 1st, 2026
mind blowncompellinglikecelebrate14 reactions

The cover of C++: The Programming Language raises questions not answered by the cover

The book C++: The Programming Language¹ (Waylon Warren, editor) claims to present “the complex subject of C++ in the most comprehensible and easy to understand language.” A rather overdone book blurb, in my opinion.

Anyway, the book does have an attractive cover, or at least an inoffensive one.

Book cover: C++ The Programming Language, with a picture of code on a computer monitor

But wait, let’s zoom in on the code shown on the computer monitor.

See article text for transcription

function updatePhotoDescription() {
    if (descriptions.length > (page * 9) + (currentImage.substring(⟦ blurry ⟧')) {
        document.getElementById("bigImageDesc").innerHTML + ⟦ blurry ⟧
    }
}

function updateAllImages() {
    var i = 1;
    while (i < 10) {
        var elementId = 'foto' + i;
        var elementIdBig = 'bigImage' + i;
        if (page * 9 + i - 1 < photos.length) {
            document.getElementById( elementId ).src = 'images/⟦ blurry ⟧
            document.getElementById( elementIdBig ).src = 'images/⟦ blurry ⟧
        } else {
            document.getElementById( elementId ).src = '';

This isn’t even C++. It’s JavaScript!

¹ Note that this is not the book The C++ Programming Language by the language inventor Bjarne Stroustrup.

Topics

Author

Raymond has been involved in the evolution of Windows for more than 30 years. In 2003, he began a Web site known as The Old New Thing which has grown in popularity far beyond his wildest imagination, a development which still gives him the heebie-jeebies. The Web site spawned a book, coincidentally also titled The Old New Thing (Addison Wesley 2007). He occasionally appears on the Windows Dev Docs Twitter account to tell stories which convey no useful information.

17 comments

Discussion is closed. Login to edit/delete existing comments.

Sort by :
  • Andrew Brown

    So this is perhaps one of the times when we should judge a book by its cover.

  • Darren Woodford · Edited

    `if (page * 9 + i – 1 < photos.length)`
    makes me want to vomit

  • Bryan W

    It’s not even a mono space font… barbaric.

  • Frank D

    Almost certainly. Why would the author (or, editor, I guess) be consulted on the book cover? They’re a writer, not a graphic designer. But it’s still a really big screwup for a tech publisher to make.

    • Raymond ChenMicrosoft employee Author

      I was consulted on the cover to my book. In fact, they asked me “What do you want the cover to look like?”

  • Rob Milliken

    Perhaps it’s the publisher creating the cover under deadline and not consulting the author?

  • Igor Levicki

    Well if the book is teaching template meta-programming then that’s about as readable as minified JS.

  • Marc Silver

    The actual sin is the sans-serif

  • R. van Twisk

    Could be just aswell a bunch of macro’s 🙂

    • LB

      Macros can’t do anything to make the single quote strings work though

      • Bwmat

        They’re just multicharacter literals

  • Dan Bugglin

    Not just JavaScript, it’s JS from some website as it uses DOM API.

    Reminds me of the DVD movie Stargate: The Ark of Truth. When our heroes are examining the source code of the evil replicators (machines that are eating their spaceship) looking for weaknesses, we see some of that code.

    Someone figured out where it was from. It was JavaScript ripped from a Canadian bank website. The movie was filmed in Vancouver, so there you go.

  • LM Hess

    If they put actual C++ on the cover, nobody would buy the book.