3 ms·
What does drive me nuts is the non-sensical spacing. - (id)foo reduces readability, while -(id) foo is much better. I realize the first one is more common
by jayvanguard 13y ago
What does drive me nuts is the non-sensical spacing.
- (id)foo
reduces readability, while
-(id) foo
is much better.
I realize the first one is more common in Apple and is probably more standard, but it begs the question why such a horrible convention ever caught on.
- mpweiher 13y agoHowever, -foo is even better. :-)
- myko 13y agoNo, -foo is confusing and reduces readability.
- mpweiher 13y agoHow so?
- myko 13y agoIt is difficult to tell at a glance if -foo is returning something or just modifying state.
- mpweiher 13y agoNo it's not. If it didn't return anything, it would be -(void)foo; This is how C and by extension, Objective-C work: to indicate "nothing" you have to put in something, specifically "void".
- bennyg 13y agoCall me crazy but I actually like the first way better. It's easier for me to read, personally. Different strokes though.
- dep_b 13y agoApple is wildly inconsistent with their example code and even the templates within XCode when you add a ViewController for example. Same line for the first accolade or the start or the next time in the same file. I always find myself correcting their code, that's just bad.