Re: [PEPr] Comment on XML::XML_FastCreate
| From: | Lukas Smith | Date: | Sat, 10 Apr 2004 13:18:05 +0000 |
| Subject: | Re: [PEPr] Comment on XML::XML_FastCreate | ||
| References: | 1 2 3 4 5 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-27389@lists.php.net to get a copy of this message | ||
Stephan Schmidt wrote:
I think Stephan makes a very valid point. There an increasing number of phpDoc aware IDE's which actually make it very convinient to use parameters instead of arrays. The way you are suggesting to use arrays seems to be like a poor man's parameter hinting. The only valid reason I see for array using is to: 1) be able to easily pass a number of parameters which get generated by another method 2) to emulate named parameters regards, Lukas Smith smith@backendmedia.com _______________________________ BackendMedia www.backendmedia.com berlin@backendmedia.com Linn Zwoch Smith GbR Pariser Str. 44 D-10707 Berlin Tel +49 30 83 22 50 00 Fax +49 30 83 22 50 07Anything that encourages people to write code that is impossible to read is never a good idea :) - I would recomend marking the 'non_array' version as depreciated, or at least sticking a warning, noting that, using all the arguments will make you code very difficult to read....I will definitely not do that. There are people who prefer passing several parameters instead of an array. And it can be useful, as some IDEs parse the docblocks and will tell the developer which parameters to pass. If I get the hint to pass an array, that's not very useful. Furthermore, only three parameters are needed in most cases: tagname, attributes and content.