Name instance variables, methods and parameters.
Name instance variables, methods and parameters.
- Subject: Name instance variables, methods and parameters.
- From: "Czarny, Eric" <email@hidden>
- Date: Tue, 27 Jan 2004 22:00:19 -0500
I know that this may be an awfully common question, but I haven't found a
single answer, nor a collection of answers, to give me a better idea. The
section on coding style within Apple's developer documentation states that
an underscore should not be used for naming private methods and instance
variables. I know I have seen this topic being discussed at CocoaDev, but
couldn't gather sufficient information. I'd like to continue to use an
underscore, but if it goes against Apple's own wishes, I'd like avoid it if
I could.
The major problem I have is if I just use an unmodified instance variable,
such as:
NSString *data;
instead of:
NSString *_data;
Which I like better, but conflicts with:
- (id)parseData: (NSData *)data;
I've seen people just use a single character as the name for the parameter
name, but I feel it makes for less readable code.
I suppose it's all a matter of personal preference, but I'd like some input
from more experienced developers.
Thanks!
Eric Czarny
_______________________________________________
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.