Re: HTML_QuickForm2 / new release

From: Date: Thu, 15 Jan 2009 09:14:49 +0000
Subject: Re: HTML_QuickForm2 / new release
References: 1 2 3  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-51427@lists.php.net to get a copy of this message
Hi,
We are using QF2 in a larger project
at work and are willing to put resources into development/completion of features missing.
That's good news :)
The first ones (ArrayAccess to e.g. use a form easily
in Smarty, and rules in containers) have been attached to the tracker. We'd like to see them released soon so that we now that a) the direction in which we're going is correct and b) don't have to change our codebase afterwards too much.
Question : It seems you are using the CVS version which has a renderer. Do you like how the renderer works ? I coded it and I am satisfied with it but I am not sure Alexey is happy with it. This is probably what holds us from making a new release, so we are open to discussion about the renderer.
If there is anything holding you back or when the quality of our
patches isn't high enough, just let me know and we do the best we can to meet your requirements.
The ArrayAccess patch http://pear.php.net/bugs/patch-display.php?bug=15618&patch=HTML_QuickForm2.diff&revision=1231774581 violates the Principle of Least Surprise severely: $form['foo'] = 'text'; echo gettype($form['foo']); // Will output "object". WTF?
I would suggest that developer expectations would change over time as more and more users because used to the spl. Can we see more intended use patterns / examples? Can we see more examples of odd/surprising behaviour? Would providing these examples in the package documentation under a 'neat but surprising tricks' section mitigate the least-surprise factor? Could the unit tests method names be made more informative (ie, testShouldActLikeAnArray() { /* .. */ } (agile documentation) ?
I like ArrayAccess too but it is a bit premature to introduce it in Containers IMO. Alexey's solution of having an Array renderer (very easy to write I think) sounds cleaner.
The Rule for Containers patch
http://pear.php.net/bugs/patch-display.php?bug=15619&patch=Rule_Compare_for_Container.diff&revision=1231775394 does exactly the same: If I do a $container->addRule('lt', 'Should be less that 4', 4); Do i expect 1) Container to contain less than 4 non empty elements? 2) Value of each element's in Container to be less than 4? 3) Sum of Container's elements' values to be less than 4? now, fellow developers, think a bit and either read the patch or scroll down
I don't get it. I don't know QF2 well enough; so reading the patch didn't make much sense. Can we have more context / expanded examples?
It seems the patch does an array_sum() which is probably not what you would expect. At the moment, this patch is not good enough and will introduce problems we will have to deal with later. Thanks in advance for your reply, -- Bertrand Mansion Mamasam Work : http://www.mamasam.com Blog : http://golgote.freeflux.net

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