3 ms·
100% disagree. For some use cases they are very useful. Like, imagine a function that generates an HTML snippet, and can optionally assign some specific class n
by TylerE 14y ago
100% disagree. For some use cases they are very useful. Like, imagine a function that generates an HTML snippet, and can optionally assign some specific class names/ids to some of the elements.
- MBCook 14y agoAs much as many people seem to hate the way Objective-C does things, I really like how it intersperses the arguments in the function name. It makes it so easy to identify parameters. Most languages: someObject.throwProduce(apple, myEnemy, 14, 17); Objective-C: [someObject throwProduce:apple at:myEnemy withForceInN:14.0 maxDisanceInM:17.0]; As long as you name the function appropriately, it's clear what each parameter does without having to look up the name. Many people complain about the long names (in this case throwProduce:at:withForceInN:maxDistanceInM:thenWaitInMS:), but it avoids the situation you have in other languages where there are 4 functions with the same name but different signatures. In Obj-C the naming conventions discourage such ambiguity and encourage self-documenting names.