kodecocodes / objective-c-style-guide

A style guide that outlines the coding conventions for Kodeco
http://www.raywenderlich.com/62570/objective-c-style-guide
3.1k stars 628 forks source link

Init section contradicts Golden path section #35

Closed icanzilb closed 10 years ago

icanzilb commented 10 years ago

Golden path states we should avoid putting code in if statements when possible. But in the Init section it says we should do:

if (self) {
...
}

while if we follow the Golden Path section this code should be:

if (!self) return nil;
...

Not sure which section is better, but it's confusing to get contradicting directions

ndubbs commented 10 years ago

We had another issue opened regarding the init method. It was decided to follow Apple's generated template and not the Golden Path section.

icanzilb commented 10 years ago

Maybe the exception is worth mention in the Golden Path section then? Because when reading the guide end to end it's something that confuses