What is the standard for naming variables and why?
Posted
by
P.Brian.Mackey
on Programmers
See other posts from Programmers
or by P.Brian.Mackey
Published on 2012-06-28T15:42:51Z
Indexed on
2012/06/28
21:24 UTC
Read the original article
Hit count: 223
objective-c
I'm going through some training on objective-c. The trainer suggests setting single character parameter names. The .NET developer in me is crying. Is this truly the convention? Why?
For example,
@interface Square : NSObject
{
int size;
}
-(void)setSize: (int)s;
I've seen developers using underscores int _size
to declar variables (I think people call the variable declared in @interface
ivar for some unknown reason). Personally, I prefer to use descriptive names. E.G.
@interface Square : NSObject
{
int Size;
}
-(void)setSize: (int)size;
C, like C# is case sensitive. So why don't we use the same convention as .NET?
© Programmers or respective owner