Theocacao
Leopard
Design Element
Comment on "Objective-C, Ruby and Python for Cocoa"
by Chuck — Feb 21
Yeah, long method names look like crap in Ruby. That's because they look like crap in Objective-C too. The ugliness of [fooObject performBar:thing withBaz:whatsit floobity:boo chocolate:NO burrito:YES] is not much less than fooObject.performBar(thing, :withBaz, whatsit, :floobity, boo, :chocolate, false, :burrito, true), in my personal opinion. They're both packing a metric ton of info into your method signature with nothing more than colons to distinguish it all.

However, Ruby's spryness gives it the edge here in my book. In Ruby, if I find myself having to write out all this crap often, I can metaprogram it out of sight in one line of code. Heck, I could make it so all the arguments are passed in as a semantically accurate dictionary and have the runtime automatically put them in the right order. Objective-C could do something similar to the first option with a macro, but it would be much less elegant and macros are gross anyway.
Back to "Objective-C, Ruby and Python for Cocoa"
Design Element

Copyright © Scott Stevenson 2004-2015