• 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: Code Guidelines
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Code Guidelines


  • Subject: Re: Code Guidelines
  • From: Georg Tuparev <email@hidden>
  • Date: Mon, 31 May 2004 15:25:26 +0200

On May 31, 2004, at 2:02 PM, M. Uli Kusterer wrote:

At 11:02 Uhr +0200 31.05.2004, Georg Tuparev wrote:
In what way "account" is communicating less useful information then say "iAccount"? And why the hell so many developers are happy to write
[accountList lastObject];
but when they add their own NSArray category, they write
[iAccountList mFisrtObject];

I occasionally have the pleasure of working with code somebody else wrote. And every time I do that, I curse at people who don't use at least a minimum of prefixes. "g" for globals should IMHO be standard. Why?

Because when I read some code that contains an assignment statement, if there are no prefixes, there is no way for me to immediately know whether this assignment has any side effects. If it's a local variable, I usually only need to glance at the top of the function to find out that's the case.

So what stops you of using NeXT/Apple's notation (e.g. NSApplicationDidFinishLaunching)? Probably is too readable, and does not impose a challenge to remember :-)

But if it is a direct assignment to a member variable,

in ObjC they are called Instance Variables!!!!

-- georg --

"War is God's way of teaching Americans about geography."
Ambrose Bierce, writer (1842-1914)
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Code Guidelines
      • From: "M. Uli Kusterer" <email@hidden>
References: 
 >Code Guidelines (From: Christoffer Lerno <email@hidden>)
 >Re: Code Guidelines (From: "M. Uli Kusterer" <email@hidden>)
 >Re: Code Guidelines (From: Georg Tuparev <email@hidden>)
 >Re: Code Guidelines (From: "M. Uli Kusterer" <email@hidden>)

  • Prev by Date: NSSearchField Menu Enabling Troubles...
  • Next by Date: Re: Determinating iChat status
  • Previous by thread: Re: Code Guidelines
  • Next by thread: Re: Code Guidelines
  • Index(es):
    • Date
    • Thread