Rightpoint / Raizlabs-Cocoa-Style

The Raizlabs iOS Style Guide
MIT License
32 stars 2 forks source link

Remove requirement to prefix properties with class identifiers #49

Open ZevEisenberg opened 9 years ago

ZevEisenberg commented 9 years ago

Never give properties generic names. Instead, prefix the variable name with a descriptor such as, but not limited to, the class name.

Preferred:

@property (strong, nonatomic) UICollectionView *myClassCollectionView;

Not:

@property (strong, nonatomic) UICollectionView *collectionView;

I forgot this existed, and few people seem to follow it. It seems redundant, since the property is already scooped to the object it belongs to.

jkaufman commented 9 years ago

Why was this ever encouraged? Were we trying to avoid a collision with hidden properties of a superclass?

ZevEisenberg commented 9 years ago

No idea. And the diff trail is cold, because apparently I copied it over from the old style guide.

jkaufman commented 9 years ago

I'd like to imagine some reasons this might have been a good idea before deleting it.