3 points · by makecheck · 15y ago · 3 comments
Method names are almost always descriptive enough. If parameter names are identical, there's less to maintain; I like using a single underscore "_" for all header-file parameters.
Here's an example of a method that has lots of parameters, where the parameter names are kind of pointless:
@interface UIView : . . .
+ (void)
transitionWithView:(UIView *) view
duration:(NSTimeInterval) duration
options:(UIViewAnimationOptions) options
animations:(void (^)(void)) animations
completion:(void (^)(BOOL finished)) completion;
They could actually have just said this (changing all names to "_"): @interface UIView : . . .
+ (void)
transitionWithView:(UIView *)_
duration:(NSTimeInterval)_
options:(UIViewAnimationOptions)_
animations:(void (^)(void))_
completion:(void (^)(BOOL finished))_;Slightly related, I'd argue that "animations" is very poorly chosen. A plural noun indicates a set or collection of objects, whereas this is a block pointer to be used for... something...
As for the name, this is Apple's method name from UIView so ask them. :)