Open franklau12 opened 9 years ago
Maybe you mean
NSInteger namesCount = ...
?
I'd call the array names
and the counter nameCount
but otherwise that makes sense to me.
The bigger point is count
was a method and not a property in the old days, but we should switch to self.names.count
. Perhaps we have Swift to thank for turning such things into properties in the modern runtime!
Thanks for the quick reply guys, I did mean nameCount or numNames, sorry :( Yes, Thanks for pointing that out, Greg. self.name.count would be better since count is a property
Could we do it this way. Since count is now a property, it'd be now under the preferred section
Preferred:
NSInteger nameCount = self.names.count;
Not Preferred:
NSInteger nameCount = [self.names count];
Is it possible to change this line: NSInteger arrayCount = [self.array count];
to either NSInteger names = self.names.count, or NSInteger names = [self.names count]
This is because I've seen a lot of inexperienced developers use array when naming an array, even though they should name using as high level of abstraction as possible (i.e. instead of nameArray, they should use names). And I think your style guide has a big influence within the Objective-C community.
Thanks