• 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: name that method!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: name that method!


  • Subject: Re: name that method!
  • From: Uli Kusterer <email@hidden>
  • Date: Fri, 28 Sep 2007 23:24:57 +0200

Am 28.09.2007 um 22:40 schrieb Ilan Volow:
It would return different representations of the dictionary based on what enum constant of type SerialFormat was passed in (e.g. JSONFormat, XMLRPCFormat, OPMLFormat, etc), and that way I wouldn't be locking myself into one particular representation of the dictionary like I would if I chose a JSON-specific name for the method. Which means I could reuse the dictionary category in other projects where I might need representations other than JSON. Which means I'd to write less code the next time around.

Unless you actually have plans to have other representations, I'd consider that over-engineered. You don't need an API with millions of selectors and parameters like the procedural QuickTime or CoreAudio if all you want to do is handle JSON mark-up. The whole point of JSON, IIRC, is to be simple and understandable (and more human- readable than XML), and if I chose to use that, I'd want the API to be a similarly clean design.


It's OK to design an API for things you plan to do, but planning for things you may need in the future usually never yields code that behaves the way you need it to, and you'll have to refactor. So you might as well design for immediate needs and then have a cleaner design in the beginning, if you'll have to refactor it anyway.

Cheers,
-- M. Uli Kusterer
http://www.zathras.de



_______________________________________________

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


  • Follow-Ups:
    • Re: name that method!
      • From: Andy Lee <email@hidden>
References: 
 >name that method! (From: Stig Brautaset <email@hidden>)
 >Re: name that method! (From: Ilan Volow <email@hidden>)

  • Prev by Date: Re: name that method!
  • Next by Date: Re: name that method!
  • Previous by thread: Re: name that method!
  • Next by thread: Re: name that method!
  • Index(es):
    • Date
    • Thread