Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101001 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48352 invoked from network); 31 Oct 2017 15:20:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Oct 2017 15:20:18 -0000 Authentication-Results: pb1.pair.com header.from=kalle.php@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=kalle.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.169 as permitted sender) X-PHP-List-Original-Sender: kalle.php@gmail.com X-Host-Fingerprint: 209.85.223.169 mail-io0-f169.google.com Received: from [209.85.223.169] ([209.85.223.169:56271] helo=mail-io0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 93/33-07742-1B498F95 for ; Tue, 31 Oct 2017 10:20:17 -0500 Received: by mail-io0-f169.google.com with SMTP id p186so35869902ioe.12 for ; Tue, 31 Oct 2017 08:20:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=2cR2RBa6xl+xYibyS345MeibqnE3RA9LIGOMTJnXSr4=; b=BAIrnaccxrHu8Vokye/tq5hRwGCz9ZaaNWtjbwsFBWcICApRlZQ3NSPOXg5ISdK1JU jU90/m1bkQxh+K4a3M+etDHDgZcPCYwQ3TPFG0drUfqfOkqgR5edgOHIekEm5H6SLnNA h0sNOh2ZNg1Ayu3dsoxaOR3CECghl5jhrjmjdqUZbTXC+NNOVlIgVMVFRUX25WTO4qG2 8RsJV7pcf3VgD2UcJc0XscBLwnIB6Vk4y/Kt2TXjsPbPhbEXQSi3mEf428Wdjal/x0Ic TBS03pqQFLmiNbrNbhPOVwKgNccGgB6pJJt1ilCvfVKxmRxHP6uOrV4hXiCpGG677xFE 99aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=2cR2RBa6xl+xYibyS345MeibqnE3RA9LIGOMTJnXSr4=; b=bxJyOj6Mer2qxl3icx2dEGBVxuv66XfkX5TCJlY4/y76ik6LHRtSbgzqfmEJ0A787d kCErfokdW9xISLWPvKj0AGWdwGeBuB+l3A/M4+4kZnbq61R6PUrcsU81yERtt/RYa+cZ u2FXLjDMolFpGWcphe/Fm4ydbUen71ANTHBk/uUTkZjvXknXuJGUA84UGmptgfmne56I TmET883ZN3L8EneKm/1sR3sYJnX9JFWH3AA1YLUGtZdDTdHS75qH+NCkjC9lkmxDjBsF xmiYFSjTDnw4CDA6wN/4uvDcnJP1VujSaQne3xGQJp4aqUWMXnjj2F/ah7+uDRlJgEU7 C66g== X-Gm-Message-State: AMCzsaVUoObVb0h6qK6dDC720A8fjheaDQlITZlOau5ZRKSRzhslA9Bw zK2o3EoFYTE/4Wxgcz5bFsW+V8v9uvXc0OThpREEXw== X-Google-Smtp-Source: ABhQp+SFkbKaZEqxiw2eTr2nQlsdsbjnsoKC9vLSwDrlqMJuVOz6Xd+PMlU8z8nqWMbaMS+JcMqHQn1WLn9KDYFQ7K4= X-Received: by 10.107.102.14 with SMTP id a14mr3002202ioc.60.1509463214925; Tue, 31 Oct 2017 08:20:14 -0700 (PDT) MIME-Version: 1.0 Sender: kalle.php@gmail.com Received: by 10.107.7.106 with HTTP; Tue, 31 Oct 2017 08:20:14 -0700 (PDT) In-Reply-To: <64.21.07742.EF158F95@pb1.pair.com> References: <64.21.07742.EF158F95@pb1.pair.com> Date: Tue, 31 Oct 2017 16:20:14 +0100 X-Google-Sender-Auth: 3-odT1FoMWKJvZFeRR74oQrfzsA Message-ID: To: Tony Marston Cc: Internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] Re: RFC - Array Of for PHP 7 From: kalle@php.net (Kalle Sommer Nielsen) Hi Tony 2017-10-31 11:35 GMT+01:00 Tony Marston : > This strikes me as being nothing more than a micro-optimisation that does > nothing but pander to the laziness of certain programmers. Instead of having > to write a few lines of code to validate something they want the language to > do it for them. It may come as a surprise to some people, but being a > programmer actually involves the writing of program code. It is not > sufficient to express an idea and have the language fill in all the details > as that forces the language to have to detect and deal with a myriad of > possibilities. I do understand where you are coming from, but I don't necessarily agree on this topic. We can (hopefully) agree that programming language design is hard, because we need to determine how fine a line we should have between things thats an integral part of the language, its standard library or its extensions and how much power the programmer has in their arsenal to do crazy things. If we boil things down, then we didn't really need the scalar type hints, PHP had been working perfectly fine for 20 years without it and while it does not add anything but a couple of checks at compile/runtime, its essentially "laziness of certain programmers" it becomes useful to. Another example is constant visibility modifiers in PHP 7.1. I think one of the advocates for features that are within that category you mention can sometimes be productivity and rid of boilerplate code. For this case with 'Array Of', I think it makes perfect sense to add with PHP7's improved type system on that regard, but thats my personal opinion. > I would evaluate each proposed change to the language with a simple question > - does it provide the greatest good to the greatest number? Considering the > fact that this RFC will only benefit a miniscule minority of developers yet > make the language more complicated, slower to run, and more difficult to > maintain as more and more edge cases are identified as "bugs", it offers > negative benefits to the vast number of programmers who are happy with the > language as it currently exists. As such it fails that test and should be > rejected. Tho you said its a micro optimization, would argue that (see [1]), it far from makes the code complicated, internally it doesn't add any complexity and only adds a member to the arg_info, which is an unsigned char, it wouldn't do anything unless a type is specified anyway and the slower to run argument above is pretty void, sure it adds a few CPU instructions but its not something you will feel unless you are Facebook, in which case you already re-implemented the language on your own. I fail to see how it offers "negative benefits to the vast number of programmers who are happy with the language as it currently exists", I myself don't like PDO, so I just use mysqli instead, great. If its not something that affects the programmer and the programmers code continue to run, I fail to see how it negatively impacts the vast majority. If I asked you how you feel about the exif extension now supports streams as arguments instead of only file names, would you care much unless you are actively using the exif extension? Probably not. [1] https://gist.github.com/KalleZ/c7ba4f78314c989e27710e4fa14e2f3e -- regards, Kalle Sommer Nielsen kalle@php.net