Re: [PEPr] Comment on Images::Image_Canvas

From: Date: Thu, 21 Jul 2005 11:05:27 +0000
Subject: Re: [PEPr] Comment on Images::Image_Canvas
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-38816@lists.php.net to get a copy of this message
Hi Toby
Having both possibilities in place seems a good idea. Don't you agree?
To some extent: yes. I cas see 2 advantages and 3 disadvantages to this: adv. 1) You can do it the way you want => more user friendly adv. 2) It's perhaps better than just having the array, since documentation is easier. Describe the parameters, and then state that BTW you can wrap all these up in a single hashed array disadv. 1) It's more error prone, since you have to remember to include the parameter in two different places disadv. 2) It causes some more overhead, having to check if it's an array and then "pull" the values from the array - I know it's probably not much, but if we all do this and have many method calls, then it causes an seemingly unecessary overhead. disadv. 3) It causes inconsistencies (at least for this package), since some method can only be used with the array, such as the done() and factory() method, so when do the user know when to do what?! (I know it's already like this in the package, which is why I take your point and want to change it). So again I think for consistency: the one or the other (whenever possible) But are there any other opinions? regards Jesper

« previous php.pear.dev (#38816) next »