Re:Cargo-cult typing, or: Objective-C's default type is id
by myko on Wednesday March 05, 2014 @08:32PM
(#7351257)
No, -foo is confusing and reduces readability.
Re:Cargo-cult typing, or: Objective-C's default type is id
by mpweiher on Thursday March 06, 2014 @02:42AM
(#7352415)
How so?
Re:Cargo-cult typing, or: Objective-C's default type is id
by myko on Thursday March 06, 2014 @09:26AM
(#7353797)
It is difficult to tell at a glance if -foo is returning something or just modifying state.
Re:Cargo-cult typing, or: Objective-C's default type is id
by mpweiher on Friday March 07, 2014 @04:37AM
(#7359301)
No 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".
-foo
is even better. :-)