Re: Convenience Methods
Re: Convenience Methods
- Subject: Re: Convenience Methods
- From: Wade Tregaskis <email@hidden>
- Date: Tue, 25 Sep 2007 22:19:15 -0700
I'm a little hesitant to throw my bit into this conversation, since I
don't see it going to any logical conclusion other than off-topic and
then moderated. Nonetheless, I must say that:
[NSMutableString mutableStringWithXXX: ...]
There's redundancy there. I've indicated the desired mutability by
specifying that I want an NSMutableString; I don't need to say any
more. When I read "stringWithXXX" I read it as "creates a 'string'
with XXX", where 'string' is just a generic usage of the term. An
NSString is a string. An NSMutableString is a string. An
NSAttributedString is a string (although that's where Foundation's
class hierarchy goes wonko).
Personally, I like strong typing, so I avoid "id" unless I really
mean "I don't know and/or care about the type of this object".
Having it there is a huge boon to problem solving, but it's there for
specific reasons, not so you can be lazy. IMHO.
Wade
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden