Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[OT] Re: Style Question




On Jun 28, 2008, at 1:25 AM, 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.

If you read the source of Unix 6th edition (available in Lion's Commentary, ISBN 1-57398-013-7), you will see that they used the "One True Brace Style(tm)" :-)


Best regards,
-Steve

--
Steve Byan <email@hidden>
Littleton, MA 01460


_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Style Question (From: "Alex Wait" <email@hidden>)
 >Re: Style Question (From: Rob Ross <email@hidden>)
 >Re: Style Question (From: Jens Alfke <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.