4 ms·
Since Obj-C messaging supports duck typing, I'm not sure I understand the argument you're making against the syntax.
by darkchasma 14y ago
Since Obj-C messaging supports duck typing, I'm not sure I understand the argument you're making against the syntax.
- dguaraglia 14y agoI might have talked out of my ass? Wouldn't be the first time, and I apologize if I did.
- chc 14y agoI believe dguaraglia is talking about the types of arguments, which are often included in the method name. So you get things like [guy eatFood:food withHand:hand usingEatingStyle:eatingStyle]. Overall, it lends itself to exceptionally long lines of code, such that Objective-C message sends are often broken into multiple lines with lots of info on the right side of the window. For example, instead of: NSWindow *window = [[NSWindow alloc] initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)windowStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)deferCreation screen:(NSScreen *)screen]; people will often write write: NSWindow *window = [[NSWindow alloc] initWithContentRect: desiredRect styleMask: windowStyle backing: NSBackingStoreBuffered defer: YES screen: [NSScreen mainScreen]]; The length of the selector requires us to choose how we're going to write this line of code.