Re: name that method!
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