• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Convenience Methods
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >RE: Convenience Methods (From: Jeff Laing <email@hidden>)

  • Prev by Date: RE: Convenience Methods
  • Next by Date: Re: Grabbing selected text in any app
  • Previous by thread: RE: Convenience Methods
  • Next by thread: Re: Convenience Methods
  • Index(es):
    • Date
    • Thread