Re: Style Question: apology and correction
Re: Style Question: apology and correction
- Subject: Re: Style Question: apology and correction
- From: Rob Ross <email@hidden>
- Date: Mon, 30 Jun 2008 14:22:20 -0700
On Jun 27, 2008, at 10:25 PM, Jens Alfke wrote:
On 27 Jun '08, at 9:45 PM, Rob Ross wrote:
Btw, how many people realize this convention comes from the early
K&R C book, and the *only* reason they wrote it this way was to
minimize the number of lines of text their examples would take up
on each page? It's a type-setting design decision, and has nothing
to do with how "pure" a programmer you are.
Do you have any citation that shows that was their rationale? From
the forward of K&R:
"The position of braces is less important, although people hold
passionate beliefs. We have chosen one of several popular styles.
Pick a style that suits you, then use it consistently."
Ergo, it was already a popular coding style in 1978. Understandably
so, as a standard terminal fit even fewer lines (only 24) than did
a page of print, so minimizing the number of lines was important in
those days if you wanted to be able to see any amount of your code
at a time.
—Jens [who learned C in 1980 using K&R 1st ed. and a VT-100]
I stand humbly corrected. I fell victim to reporting something I read
"on the internet" as fact without checking for sources.
I had seen several people whom I respected mention the theory of the
book publisher as driving the use of a particular style in the
original K&R "The C Programming Language" book, and have been
repeating this as fact. But after your email challenging me to find
sources, I could not do so after several hours of searching.
So I contacted the sources - both K&R, and to my amazement received
email replies from both of them. They stated they had never advocated
for any particular style, and that it was better just to be
consistent with whatever one chose. And their use of the K&R style
was well established by Ken Thompson, and something all the members
of the original Unix and C compiler teams adopted, and still use to
this day. So the use in the book of the K&R style represented what
they themselves used on a daily basis.
So please accept my apology for propagating another internet rumor.
We programmers really need something like snopes.com for programming
myths :)
Rob Ross, Lead Software Engineer
E! Networks
---------------------------------------------------
"Beware of he who would deny you access to information, for in his
heart he dreams himself your master." -- Commissioner Pravin Lal
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden