Twitter | Search | |
Dave DeLong
not prefixes, use suffixes!! That way you can still use autocomplete w/o remembering that it's a custom method.
Reply Retweet Like More
Andrew Garn 1 Oct 12
Replying to @davedelong @borkware
Where would you put a suffix on a multi param category method? e.g. - (void)setObject:(id)obj atIndex:(NSUInteger)idx
Reply Retweet Like
Dave DeLong 1 Oct 12
Replying to @andrewgarn @borkware
I would probably do: setObject:atIndex_dd:
Reply Retweet Like
Mark Dalrymple 1 Oct 12
Replying to @andrewgarn @davedelong
I like prefixes to make it immediately obvious it's a category. bnrSetObject:atIndex: |
Reply Retweet Like
Andrew Garn 1 Oct 12
Replying to @borkware @davedelong
I prefer myMethod_AG for auto complete reasons, but it looks wrong for setters, adds confusion to the last variable
Reply Retweet Like
Dave DeLong 1 Oct 12
I prefer suffixes so that I don’t have to remember its a category method w/autocomplete. thinks I’m crazy 😃
Reply Retweet Like
Andrew Garn 1 Oct 12
Does that mean the official recommendation is that we use prefixes? Couldn’t find any mention in the docs.
Reply Retweet Like
Steve Weller 1 Oct 12
Always a suffix (with underscore for visual separation) on the method name. Autocomplete FTW.
Reply Retweet Like
Dave DeLong 1 Oct 12
interesting; nor could i. : where’re the docs on category method naming conventions?
Reply Retweet Like
Mark Dalrymple 1 Oct 12
Like it I don't suffixes backwards because everything else cocoa in |
Reply Retweet Like
Mark Dalrymple 1 Oct 12
Replying to @davedelong
Kind of oogs me out to optimize for typing rather than reading . That's what gives us stuff like 'creat'
Reply Retweet Like
Vincent Esche 2 Oct 12
Replying to @davedelong @Selector
as in (fooWithBar:baz:) →(fooWithBar_suffix:baz:) for multi-argument methods? Hm…, might give it a try. 👍
Reply Retweet Like
Mark Dalrymple 5 Jun 14
Replying to @davedelong
Yuck. Going against every other -fix in the environment just to coddle a tool. How about underscores at the end of ivars?
Reply Retweet Like
Mark Dalrymple 5 Jun 14
Replying to @davedelong
Besides, I think it's *good* to remember it's a category when writing, and to decide if the corresponding risks are worthwhile.
Reply Retweet Like