On Fri, 16 Jul 2004, John Siracusa wrote:

> On 7/16/04 7:18 PM, Dave Rolsky wrote:
> >> Anyway, what percentage of accessors take "arguments to affect what they
> >> return"?  If you want to return different kinds of things, you should make
> >> different accessors, IMO.
> >
> > Well, you have to balance few methods/many arguments versus many
> > methods/few arguments.
> >
> > For example, having a different ymd() variant for every possible separator
> > character would clearly be wrong.
>
> Well, I would have either put all of that under the generic string
> formatting method(s) or made the call look like this:
>
>     $dt->ymd(sep => '*')
>
> which IMO is more self-documenting than this:
>
>     $dt->ymd('*')
>
> (Anyway, ymd() isn't a get/set method at all, is it?)

It's a _get_ method.  You're retrieving information from the object,
right?  It's just not getting a single attribute.


-dave

/*=======================
House Absolute Consulting
www.houseabsolute.com
=======================*/

Reply via email to