Origin of the story that K&R style was chosen to save paper

Discussion in 'C Programming' started by Paul Sinnett, Nov 27, 2012.

  1. Paul Sinnett

    Paul Sinnett Guest

    I've been told by several people that the reason the K&R style was chosen for the C Programming Language book was because the publisher wanted to reduce the length of the book. But I've been unable to find any authoritative source for the story. Does anyone know where this idea comes from? An interview maybe?
     
    Paul Sinnett, Nov 27, 2012
    #1
    1. Advertising

  2. Paul Sinnett <> writes:
    > I've been told by several people that the reason the K&R style was
    > chosen for the C Programming Language book was because the publisher
    > wanted to reduce the length of the book. But I've been unable to find
    > any authoritative source for the story. Does anyone know where this
    > idea comes from? An interview maybe?


    A bit of Googling found a discussion at
    <http://ubuntuforums.org/archive/index.php/t-891532.html> which
    includees this comment from a bruce89, posted August 16th, 2008:

    I wonder if people know there's a note in K&R which says "we're
    doing it like this to save paper".

    I don't know whether this is true; I don't remember seeing such a note.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    Will write code for food.
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
     
    Keith Thompson, Nov 28, 2012
    #2
    1. Advertising

  3. Paul Sinnett

    Ian Collins Guest

    Keith Thompson wrote:
    > Paul Sinnett <> writes:
    >> I've been told by several people that the reason the K&R style was
    >> chosen for the C Programming Language book was because the publisher
    >> wanted to reduce the length of the book. But I've been unable to find
    >> any authoritative source for the story. Does anyone know where this
    >> idea comes from? An interview maybe?

    >
    > A bit of Googling found a discussion at
    > <http://ubuntuforums.org/archive/index.php/t-891532.html> which
    > includees this comment from a bruce89, posted August 16th, 2008:
    >
    > I wonder if people know there's a note in K&R which says "we're
    > doing it like this to save paper".
    >
    > I don't know whether this is true; I don't remember seeing such a note.


    The only style note I remember is "we have chosen one of several popular
    styles" in K&R 1.

    --
    Ian Collins
     
    Ian Collins, Nov 28, 2012
    #3
  4. Paul Sinnett <> writes:

    > I've been told by several people that the reason the K&R style was
    > chosen for the C Programming Language book was because the publisher
    > wanted to reduce the length of the book. But I've been unable to find
    > any authoritative source for the story. Does anyone know where this
    > idea comes from? An interview maybe?


    I don't think there's anything to this story. For one thing, the same
    style was widely used for programs in B long before C and the K&R book.

    --
    Ben.
     
    Ben Bacarisse, Nov 28, 2012
    #4
  5. Paul Sinnett

    Rosario1903 Guest

    On Tue, 27 Nov 2012 22:06:37 -0700, Cal Dershowitz wrote:
    >On 11/27/2012 08:30 PM, Cal Dershowitz wrote:
    >> On 11/27/2012 07:02 PM, Ben Bacarisse wrote:
    >>> Paul Sinnett writes:


    >> If there is any truth to it re K&R2, I'll contend it was in the table of
    >> printf specifiers.

    >
    >IIRC, it doesn't even exist. Refer to sprintf.


    it is fprintf()...
     
    Rosario1903, Nov 28, 2012
    #5
  6. Paul Sinnett

    Rui Maciel Guest

    Paul Sinnett wrote:

    > I've been told by several people that the reason the K&R style was chosen
    > for the C Programming Language book was because the publisher wanted to
    > reduce the length of the book. But I've been unable to find any
    > authoritative source for the story.


    I don't know if that's true or not, but you will be hard-pressed to find a
    single book publisher that doesn't want to reduce the length of the books
    they publish. I personally know of a case where a book publisher pressed
    the author of a technical book to edit down a 400-ish page draft to fit in a
    glossy 200-page publication.

    So, I suspect that the statement "the reason the $terse_style was chosen for
    $random_book was because $random_publisher wanted to reduce the length of
    the book" will essentially be true for pretty much every book published
    through a publisher.


    Rui Maciel
     
    Rui Maciel, Nov 28, 2012
    #6
  7. Paul Sinnett

    Rui Maciel Guest

    Cal Dershowitz wrote:

    > If saving paper were a priority, no one would call sarah palin an author.


    You'd be surprised with what this desire to save paper forces some editors
    to do. For example, I was told that the style adopted for a table included
    in the EN 1993-1 standard, which sacrificed pretty much any readability, was
    due to economy reasons: someone wanted to reduce publishing costs by
    avoiding having to print one or two extra pages on a 100-page document.


    Rui Maciel
     
    Rui Maciel, Nov 28, 2012
    #7
  8. Paul Sinnett

    Paul Sinnett Guest

    On Wednesday, 28 November 2012 10:56:27 UTC, Rui Maciel wrote:
    > So, I suspect that the statement "the reason the $terse_style was chosen for
    > $random_book was because $random_publisher wanted to reduce the length of
    > the book" will essentially be true for pretty much every book published
    > through a publisher.


    I think the implication of the assertion is that it was a poor style choice imposed by the publisher which has since made life hell for a generation or more of C programmers. I'm guessing this assertion was created as part of a flame war of some kind.

    But I've found nothing to back it up other than vague references that don't appear to exist in reality. From what I can tell K&R had a free choice of style and just happened to choose a popular one at the time.
     
    Paul Sinnett, Nov 28, 2012
    #8
  9. Rui Maciel <> writes:
    <snip>
    > So, I suspect that the statement "the reason the $terse_style was chosen for
    > $random_book was because $random_publisher wanted to reduce the length of
    > the book" will essentially be true for pretty much every book published
    > through a publisher.


    Maybe one can say that book length will always be the reason a terse
    style is not rejected, but it won't always be the reason it's chosen.

    --
    Ben.
     
    Ben Bacarisse, Nov 28, 2012
    #9
  10. Rui Maciel <> wrote:
    > Cal Dershowitz wrote:


    >> If saving paper were a priority, no one would call sarah palin an author.


    > You'd be surprised with what this desire to save paper forces some editors
    > to do. For example, I was told that the style adopted for a table included
    > in the EN 1993-1 standard, which sacrificed pretty much any readability, was
    > due to economy reasons: someone wanted to reduce publishing costs by
    > avoiding having to print one or two extra pages on a 100-page document.


    I don't know specific numbers, but printing likes certain page counts
    better than others. It might be that the choice was 100 or 120 pages.

    If you look at a book from the end, you will see that pages come in
    little groups, making it hard to add just one or two pages.

    And you know we all want to keep the cost of standards documents down.

    -- glen
     
    glen herrmannsfeldt, Nov 28, 2012
    #10
  11. Paul Sinnett

    BartC Guest

    "Robert Wessel" <> wrote in message
    news:...

    >><> wrote:


    >>>Reasonably common are 8, 16 and 24 page press sheets, and 64 page


    > And, of course, a x32 press sheet requires *four* folds, not three.


    How many folds to get 24 pages?

    --
    Bartc
     
    BartC, Nov 28, 2012
    #11
  12. "BartC" <> writes:

    > "Robert Wessel" <> wrote in message
    > news:...
    >
    > >><> wrote:

    >
    > >>>Reasonably common are 8, 16 and 24 page press sheets, and 64 page

    >
    > > And, of course, a x32 press sheet requires *four* folds, not three.

    >
    > How many folds to get 24 pages?


    4: A Z-fold in one direction, and then two regular folds parrallel to
    the other edge of the paper.

    --
    /Wegge

    Leder efter redundant peering af dk.*,linux.debian.*
     
    Anders Wegge Keller, Nov 28, 2012
    #12
  13. Paul Sinnett

    Jorgen Grahn Guest

    On Wed, 2012-11-28, Paul Sinnett wrote:
    ....
    > But I've found nothing to back it up other than vague references
    > that don't appear to exist in reality. From what I can tell K&R had a
    > free choice of style and just happened to choose a popular one at the
    > time.


    I cannot help thinking maximizing what you could read on a vt100 (or
    whatever terminal these guys were using) had something to do with it,
    too. It's *still* a reason I use it, and I'm on a fancy 1920x1200
    display; my Emacs is 90 lines high.

    /Jorgen

    --
    // Jorgen Grahn <grahn@ Oo o. . .
    \X/ snipabacken.se> O o .
     
    Jorgen Grahn, Nov 28, 2012
    #13
  14. Robert Wessel <> wrote:

    (snip, someone wrote)
    >>> You'd be surprised with what this desire to save paper forces some editors
    >>> to do. For example, I was told that the style adopted for a table included
    >>> in the EN 1993-1 standard, which sacrificed pretty much any readability, was
    >>> due to economy reasons: someone wanted to reduce publishing costs by
    >>> avoiding having to print one or two extra pages on a 100-page document.


    (snip, then I wrote)
    >>I don't know specific numbers, but printing likes certain page counts
    >>better than others. It might be that the choice was 100 or 120 pages.


    >>If you look at a book from the end, you will see that pages come in
    >>little groups, making it hard to add just one or two pages.


    >>And you know we all want to keep the cost of standards documents down.


    > OT digression into book printing:


    > When printing book-style documents, the sheet physically printed (a
    > "press sheet") most commonly has 32 pages printed on it (16 on each
    > side), arranged in such a way that three foldings produce a section (a
    > "signature") of book (16 sheets, 32 consecutive pages), in the correct
    > order and orientation and ready to bind. So the usual increment is 32
    > pages.


    Yes. I was trying to remember what they were called.

    > Reasonably common are 8, 16 and 24 page press sheets, and 64 page
    > sheets happen on occasion. Sometimes a printer will put one smaller
    > sheet at the end of a book (usually only with books mainly printed on
    > 32 and 64 page press sheets), but that usually only happens on rather
    > large press runs due to the extra setup work.


    > And as you might expect, the cost is typically based on the number of
    > press sheets.


    > But the choice would unlikely be 100 vs. 120 pages, although 96 vs.
    > 112 or 128 is certainly plausible.


    Yes, I said that I didn't know the exact numbers, and used those as
    examples. I suppose in this group I could have used powers of two,
    to make everyone happy.

    > And yes, I've definitely seen people work to get under one of those
    > boundaries.


    -- glen
     
    glen herrmannsfeldt, Nov 28, 2012
    #14
  15. Paul Sinnett

    Tim Rentsch Guest

    Paul Sinnett <> writes:

    > I've been told by several people that the reason the K&R style was
    > chosen for the C Programming Language book was because the publisher
    > wanted to reduce the length of the book. But I've been unable to find
    > any authoritative source for the story. Does anyone know where this
    > idea comes from? An interview maybe?


    Folklore. A sample quote:

    Regarding brace placement: I like to spread the rumor that
    K&R originally prefered the more spread out layout but were
    coerced into the more compact layout by their book publisher
    in order to save paper.

    Several web searches turned up only a handful of references (the
    quote above is from the 2006-05-19 set of postings). The last
    item on the list is this very thread!

    1992-11-06 https://groups.google.com/group/com...992-11/6b16ccb2c46b639e?rnum=181&lnk=ol&hl=pt
    2004-11-01 https://forums.oracle.com/forums/thread.jspa?threadID=1558584
    2005-05-24 http://compgroups.net/comp.programming/commenting-style-question/549175
    2006-05-19 http://forum.beyond3d.com/showthread.php?t=30892&page=2
    2007-07-07 http://java-knowledge.developerfaqs.com/q_java-tech_80214.html
    2009-09-14 http://www.linuxquestions.org/questions/programming-9/programming-philosophy-363010/
    2012-11-27 http://www.velocityreviews.com/foru...t-k-and-r-style-was-chosen-to-save-paper.html
     
    Tim Rentsch, Dec 17, 2012
    #15
  16. Paul Sinnett

    Tim Rentsch Guest

    Rui Maciel <> writes:

    > Paul Sinnett wrote:
    >
    >> I've been told by several people that the reason the K&R style was chosen
    >> for the C Programming Language book was because the publisher wanted to
    >> reduce the length of the book. But I've been unable to find any
    >> authoritative source for the story.

    >
    > I don't know if that's true or not, but you will be hard-pressed to find a
    > single book publisher that doesn't want to reduce the length of the books
    > they publish. I personally know of a case where a book publisher pressed
    > the author of a technical book to edit down a 400-ish page draft to fit in a
    > glossy 200-page publication.
    >
    > So, I suspect that the statement "the reason the $terse_style was chosen for
    > $random_book was because $random_publisher wanted to reduce the length of
    > the book" will essentially be true for pretty much every book published
    > through a publisher.


    This idea is easily refuted simply by observing the enormous
    numbers of C or C++ books (not to mention Java, etc) that
    use an open bracing style in their code samples.
     
    Tim Rentsch, Dec 17, 2012
    #16
  17. Tim Rentsch <> writes:
    > Rui Maciel <> writes:

    [...]
    >> So, I suspect that the statement "the reason the $terse_style was chosen for
    >> $random_book was because $random_publisher wanted to reduce the length of
    >> the book" will essentially be true for pretty much every book published
    >> through a publisher.

    >
    > This idea is easily refuted simply by observing the enormous
    > numbers of C or C++ books (not to mention Java, etc) that
    > use an open bracing style in their code samples.


    And by the assumption that all publishers have the same policies.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    Will write code for food.
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
     
    Keith Thompson, Dec 17, 2012
    #17
  18. Paul Sinnett

    Tim Rentsch Guest

    Keith Thompson <> writes:

    > Tim Rentsch <> writes:
    >> Rui Maciel <> writes:

    > [...]
    >>> So, I suspect that the statement "the reason the $terse_style was chosen for
    >>> $random_book was because $random_publisher wanted to reduce the length of
    >>> the book" will essentially be true for pretty much every book published
    >>> through a publisher.

    >>
    >> This idea is easily refuted simply by observing the enormous
    >> numbers of C or C++ books (not to mention Java, etc) that
    >> use an open bracing style in their code samples.

    >
    > And by the assumption that all publishers have the same policies.


    I'm sure that by now such books have appeared from so many
    different publishers that all relevant ones are represented.
     
    Tim Rentsch, Dec 20, 2012
    #18
  19. Tim Rentsch <> writes:
    > Keith Thompson <> writes:
    >> Tim Rentsch <> writes:
    >>> Rui Maciel <> writes:

    >> [...]
    >>>> So, I suspect that the statement "the reason the $terse_style was
    >>>> chosen for $random_book was because $random_publisher wanted to
    >>>> reduce the length of the book" will essentially be true for pretty
    >>>> much every book published through a publisher.
    >>>
    >>> This idea is easily refuted simply by observing the enormous
    >>> numbers of C or C++ books (not to mention Java, etc) that
    >>> use an open bracing style in their code samples.

    >>
    >> And by the assumption that all publishers have the same policies.

    >
    > I'm sure that by now such books have appeared from so many
    > different publishers that all relevant ones are represented.


    I don't want to spend too much time on this profoundly trivial point,
    but ... well, actually, apparently I do want to spend too much time
    on it.

    It's not inherently implausible that Prentice Hall, back in 1978,
    asked Kernighan and Ritchie to use a particular brace style in
    their book to save paper (and presumably that K&R2 used the same
    style for consistency, or because it wasn't worth the effort to
    change it). This could have been the whim of an individual editor,
    which wouldn't apply to other publishers, or even to other books
    by the same publisher.

    What's even more plausible, though, is that K&R (both editions) use
    the brace style they do because it's the same one used by earlier C
    reference manuals going back to 1974, and Ken Thompson's B manual
    of 1972. (BCPL didn't use curly braces.) That brace style may
    well have been motivated by saving paper, but presumably Prentice
    Hall was not involved.

    References:
    http://cm.bell-labs.com/cm/cs/who/dmr/kbman.pdf (B)
    http://cm.bell-labs.com/cm/cs/who/dmr/cman74.pdf (early C)
    http://cm.bell-labs.com/cm/cs/who/dmr/cman.pdf (slightly later C,
    still pre-K&R1)

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    Will write code for food.
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
     
    Keith Thompson, Dec 20, 2012
    #19
  20. Paul Sinnett

    Tim Rentsch Guest

    Keith Thompson <> writes:

    > Tim Rentsch <> writes:
    >> Keith Thompson <> writes:
    >>> Tim Rentsch <> writes:
    >>>> Rui Maciel <> writes:
    >>> [...]
    >>>>> So, I suspect that the statement "the reason the $terse_style was
    >>>>> chosen for $random_book was because $random_publisher wanted to
    >>>>> reduce the length of the book" will essentially be true for pretty
    >>>>> much every book published through a publisher.
    >>>>
    >>>> This idea is easily refuted simply by observing the enormous
    >>>> numbers of C or C++ books (not to mention Java, etc) that
    >>>> use an open bracing style in their code samples.
    >>>
    >>> And by the assumption that all publishers have the same policies.

    >>
    >> I'm sure that by now such books have appeared from so many
    >> different publishers that all relevant ones are represented.

    >
    > I don't want to spend too much time on this profoundly trivial point,
    > but ... well, actually, apparently I do want to spend too much time
    > on it.


    Me too, and me too. :)

    > It's not inherently implausible that Prentice Hall, back in 1978,
    > asked Kernighan and Ritchie to use a particular brace style in
    > their book to save paper (and presumably that K&R2 used the same
    > style for consistency, or because it wasn't worth the effort to
    > change it). [snip elaboration]


    Possibly, but I don't think it happened. The point of my
    earlier remark was to undercut one of the arguments that
    it "likely could have happened" (my paraphrase), because the
    current evidence is that the putattive editorial pressure
    for changing bracing style is at best small, and may even
    be zero. In the absence of any evidence suggesting that it
    did happen, and considering the presence of evidence that
    the story is just folklore, ISTM the most sensible conclusion
    is just that: it didn't happen, and is only folklore. That
    isn't meant to be an argument, just a statement of my personal
    assessment.
     
    Tim Rentsch, Dec 21, 2012
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michelle Stone
    Replies:
    0
    Views:
    427
    Michelle Stone
    Oct 15, 2003
  2. Quasimido CSS
    Replies:
    2
    Views:
    6,685
    Quasimido CSS
    Nov 7, 2005
  3. Skip Montanaro

    Propagating poorly chosen idioms

    Skip Montanaro, Apr 5, 2005, in forum: Python
    Replies:
    3
    Views:
    277
    Roy Smith
    Apr 6, 2005
  4. Replies:
    1
    Views:
    267
    Ben Finney
    Oct 23, 2006
  5. rickman
    Replies:
    9
    Views:
    897
    Colin Paul Gloster
    Jul 21, 2009
Loading...

Share This Page