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

P

Paul Sinnett

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?
 
K

Keith Thompson

Paul Sinnett said:
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.
 
I

Ian Collins

Keith said:
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.
 
B

Ben Bacarisse

Paul Sinnett said:
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.
 
R

Rui Maciel

Paul said:
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
 
R

Rui Maciel

Cal said:
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
 
P

Paul Sinnett

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.
 
B

Ben Bacarisse

Rui Maciel said:
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.
 
G

glen herrmannsfeldt

Rui Maciel said:
Cal Dershowitz 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.

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
 
J

Jorgen Grahn

.
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
 
G

glen herrmannsfeldt

(snip, someone wrote)
(snip, then I wrote)
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
 
T

Tim Rentsch

Paul Sinnett said:
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
 
T

Tim Rentsch

Rui Maciel said:
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.
 
K

Keith Thompson

Tim Rentsch said:
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.
 
T

Tim Rentsch

Keith Thompson said:
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.
 
K

Keith Thompson

Tim Rentsch said:
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)
 
T

Tim Rentsch

Keith Thompson said:
Tim Rentsch said:
Keith Thompson said:
[...]
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,805
Latest member
ClydeHeld1

Latest Threads

Top