• 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: Jean-Denis Muys <email@hidden>
  • Date: Fri, 28 May 2004 09:09:07 +0200

It feels awkward to me as well. I tend to use the old guidelines from when I was using MacApp:

1- instance variables start with a lower-case "f" (as in "field")

I also like a few other ones, such as:

2- global variables (and hence static ones too) start with a lower case "g", as in "global"
3- constants start with a lower case "k"
4- compile-time variables start with a lower case "q", e.g. "if (qDebug) { ... }"

The problem with #1 above is that it doesn't fit very well with key-value coding. Overall, I haven't really completely made up my mind about that question.

Jean-Denis


On May 28, 2004, at 7:00 AM, email@hidden wrote:


Message: 1
To: email@hidden
From: Christoffer Lerno <email@hidden>
Subject: Code Guidelines
Date: Fri, 28 May 2004 12:16:58 +0800

Short version:
What is the general consensus of how to name instance variables so that
they can be separated from local variables and parameters?



Anyway, why don't I use my java guidelines then? Because none of the
code I see anywhere is using one-letter prefixes like my java code and
it makes my code look like it doesn't mesh so well with the other stuff
out there.

What are your guidelines and why?
_______________________________________________
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: Ondra Cada <email@hidden>
  • Prev by Date: Style management in NSTextView
  • Next by Date: Re: Flattening Mac resource files?
  • Previous by thread: Re: Code Guidelines
  • Next by thread: Re: Code Guidelines
  • Index(es):
    • Date
    • Thread