On 6 September 2017 at 13:31, Rowan Collins <rowan.coll...@gmail.com> wrote: > I'm going to assume that the code you posted was something of a straw > man, and you're not actually advocating people copy 20 lines of code for > every variable they want to validate.
You assume wrong. No it's not, and yes I am. I can point a junior developer at the function and they can understand it. If I ask that junior developer to add an extra rule that doesn't currently exist, they can without having to dive into a full library of validation code. If I need to modify the validation based on extra input (e.g whether the user has already made several purchases, or whether they're a brand new signup), it's trivial to add that to the function. This is one of the times where code re-use through copying and pasting is far superior to trying to make stuff "simple" by going through an array based 'specification'. It turns out that that doesn't save much time to begin with, and then becomes hard to manage when your requirements get more complication. > I can certainly see the argument for that. In that case, how would > you like to see the language evolve: I do not believe that trying to design features through an email conversation, is a productive use of individual peoples time. But also, this list is sent to thousands of people. The number of back and forth messages required to (possibly) come up with a decent design mulitplied thousands of people is a huge time sink. I believe it is far more productive to come up with a good idea off-list, and then present an almost finished version for discussion, rather than design features from scratch via this list. cheers Dan Ack -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php