• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Style Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Style Question


  • Subject: Re: Style Question
  • From: Rob Ross <email@hidden>
  • Date: Fri, 27 Jun 2008 21:45:55 -0700

I love this one. This becomes a religious issue for some people.

Both styles are popular, you should feel comfortable reading either one. Write in the one you like best.

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.

On the tabbing issue, XCode seems to format each line *after* you hit return. It usually fixes the line and does the right thing. So type your {, hit return, type your next line, hit return, and see if that then indents the previous line for you.


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




On Jun 27, 2008, at 9:30 PM, Alex Wait wrote:

I have noticed, coming from C++ and Visual Studio (at school), a couple
style differences


if (value) {
    //do something
}

insteasd of

if (value)
{
    //do something
}

Also since I am using this style, XCode doesn't tab in for me when I type {
then a return. This is the style I "taught" and I would like to continue the
good habits
during the summer.


Is this a Cocoa style? I've seen it on this mailing list and in the
Hillegeass book.

--
If you can't be kind, at least have the decency to be vague.
_______________________________________________

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

_______________________________________________

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


  • Follow-Ups:
    • Re: Style Question
      • From: Jens Alfke <email@hidden>
References: 
 >Style Question (From: "Alex Wait" <email@hidden>)

  • Prev by Date: Re: Style Question
  • Next by Date: Re: Style Question
  • Previous by thread: Re: Style Question
  • Next by thread: Re: Style Question
  • Index(es):
    • Date
    • Thread