Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100425 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 81618 invoked from network); 6 Sep 2017 20:33:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Sep 2017 20:33:58 -0000 Authentication-Results: pb1.pair.com header.from=danack@basereality.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=danack@basereality.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain basereality.com from 74.125.83.52 cause and error) X-PHP-List-Original-Sender: danack@basereality.com X-Host-Fingerprint: 74.125.83.52 mail-pg0-f52.google.com Received: from [74.125.83.52] ([74.125.83.52:37068] helo=mail-pg0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 61/A9-10715-4BB50B95 for ; Wed, 06 Sep 2017 16:33:58 -0400 Received: by mail-pg0-f52.google.com with SMTP id d8so17133231pgt.4 for ; Wed, 06 Sep 2017 13:33:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=basereality-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=/q4q6NNuC4D3qGlTZdjGpBRaTUjnnE45y8R3fURtVpU=; b=gB4kouDBtqbedQM5NxNertU31PKKhABuPY5tHf2D0F6dkItpEyuUQwyIfwDFngIjE8 P/xe1GYrKYlVs7pxtKTlgacvzRlpmPbaOHCHFMTnQzDdHhVYLvnoiKLPcvCIZ7VbuY2m 9J0ZM9+zGGCtDZtyfgFvyei4o1StB14LMTjGSQnjPKgRkvy1Reu1gFiLRVgIE2FbrHVh I1To8DBfDqSkGUrEF3zkOIHlmz7mGS2UI70Hl99Pjo41B+rZTKl7nPlyBPaBWjK770no 6gtFhCt9iQOVnab5qWV8ni2OJJg+YJhyD7DGH+7Ymx59eZufrSk5O8gwBUPYFqF9QZTt v3uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=/q4q6NNuC4D3qGlTZdjGpBRaTUjnnE45y8R3fURtVpU=; b=TeXGCMkMoe3+d3IBULcWN6RXxs737BxZyxVIpEcPnJavgUCi9wRtg9rNW9bp9NQNdy XeZJ0GaSrapivMVaSNfOFObvdhJ0TGoTl/xUWAuOUuZa8nXgADbcEOjtq3ceYfEuCM+T U6bqLmmABrmqupvOnWTAwxtVdSSTg+4B/5hobqwUeMJFgeCdkypRiwCG3dAo8D9Ffimw oy+8myyem04VVoztet3GSeen4rI5ZZvE1uA9l5xRFg/l3t9pjkDGT3njxMEOXcj5s4q7 FRDQ0PJ+5JgYm+WmiCfLgQG6jkVl5udyd32sfJPlcVqyoqiKic2V7o/i5Rp0QtwEZDZ8 empw== X-Gm-Message-State: AHPjjUh5/1Klw2q8EGAZ3MQSQCyec27IRuZt0FY2JHr90EBw2MTzzGN+ 4neYa2Ca+nuqi3+yIDxBPkn7IVhOUknV X-Google-Smtp-Source: ADKCNb59imAmVdWlKonfwtfOUym789iPnfgxgC6wTZKT5rIlxvtLdwnoSlL+NFFgvgsZqp0RCfPLqkKrOFBNMs9ykWQ= X-Received: by 10.84.210.39 with SMTP id z36mr383089plh.343.1504730033855; Wed, 06 Sep 2017 13:33:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.180.133 with HTTP; Wed, 6 Sep 2017 13:33:53 -0700 (PDT) X-Originating-IP: [77.99.17.151] In-Reply-To: References: <0C7F986C-B0BC-4315-98ED-B4FD003B9399@gmail.com> <2a4491b4-e6f5-4297-beec-363f373a93e6@lsces.co.uk> <3f8be7b1-0e59-21c6-4fe8-8299b2c05645@rhsoft.net> <6ba62d62-f1ab-9e7b-93f0-a1a9238c47a6@lsces.co.uk> <0db9cfa3-2b31-ee41-713c-889b7cc06406@lsces.co.uk> Date: Wed, 6 Sep 2017 21:33:53 +0100 Message-ID: To: Rowan Collins Cc: PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] A validator module for PHP7 From: danack@basereality.com (Dan Ackroyd) On 6 September 2017 at 13:31, Rowan Collins 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