Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106788 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 1001 invoked from network); 29 Aug 2019 08:50:15 -0000 Received: from unknown (HELO mail-io1-f44.google.com) (209.85.166.44) by pb1.pair.com with SMTP; 29 Aug 2019 08:50:15 -0000 Received: by mail-io1-f44.google.com with SMTP id j4so4574445iog.11 for ; Wed, 28 Aug 2019 23:22:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6OWGB4Xaxr1NDG8SB5gTXNs50/YR2Ixx0tNEXjcz90A=; b=LmGfyN5xaf7LCN05+gnLFHyiGjwMfC/DzeeR2kNBVdyuKrBiYOi41ny2KLt/9//if3 0UzHySWB4Wq70yBjsP4Nb1R8D54vffDb6GZBrItaSHc6B1iW/zJpqURQcOwfKaA3E+v8 EG8rqCmmLg3qflrlWT91qYf+73O9ydIPem+Q/7kenIaHLuKfzmGYqN+tsyn+OivysZaW 8gSO/PuQRydFuw3ORpOAsxpygEnlL31GZ1DJ7FNAdLEAi7p9uQBOqjYtXrz8sUoD40C7 iDQ78uv7ozm+cb3Y5gT2ay1l8N4eTkS+d0oCOAQsjre0eJQGqkqHti0QSchkhhJ6MXvy Y3yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6OWGB4Xaxr1NDG8SB5gTXNs50/YR2Ixx0tNEXjcz90A=; b=FV4pQAqnpTCPHJ55gex4aSY/PPDWCno25nCWj2ldfxGyXq5/aMX7lnPjD45scHEC5X dJLiLtwKr6fu2B3Qr6K7GI8AHnOiC9zM7pTUkz66s/MSB++Tlfh1PWCawZNUIEcsQPnm mRyB/IJqbIYJQgOrB1g22buG1IOtZ/MYmSsuZPOZ8AT3La63IOuTPqBnysWjReDvVCsW zm+CbEPYSYNNRU1aXm0kg2zWpb1kA4+q9dA+yhD8Fi4p94TkAgXj0cY8EHpZ0ivvGCix LuPVP6BCW2fydpEa0nI8BzUysOaLzutIeh1LQ9CIZ9FoaiY7suaCZ4HedT3GG6Ief9MK /aTg== X-Gm-Message-State: APjAAAWd31GD28tnq5C8PHRjr3gCmJ5Ioz27idk3NKniENzHZfEOHv3Q ssZXVp3LLE2KFyKNGXPzH274b71Vxm6h0TOB39A= X-Google-Smtp-Source: APXvYqzJAVSnkkJKgNIBMLOljrNEiL7cpgFJVIP0pPkOCI8KxGptnXtSJqkmUYzss1wGMLHYkz8f5DVg5bscobRvn+Y= X-Received: by 2002:a5e:a80f:: with SMTP id c15mr5869300ioa.270.1567059755015; Wed, 28 Aug 2019 23:22:35 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 29 Aug 2019 09:22:21 +0300 Message-ID: To: Zeev Suraski Cc: Matthew Brown , PHP internals Content-Type: multipart/alternative; boundary="0000000000000a24f105913b882b" Subject: Re: [PHP-DEV] [RFC] Reclassifying engine warnings From: drealecs@gmail.com (=?UTF-8?Q?Alexandru_P=C4=83tr=C4=83nescu?=) --0000000000000a24f105913b882b Content-Type: text/plain; charset="UTF-8" Zeev, When you write code, in a "productive" way that you mention, it's perfectly fine if you write it for you and for now. But most often, we write code for the future generations of developers that could be less skilled, for the future you that might have less context. Also, code will evolve in time and bugs will eventually apear. In my opinion and maybe you can agree, some of these bugs could be avoided if variable definition before reading would be enforced. Yes, it costs us more time to do it and productivity might be decreased by 1-2%. For most of the developers and businesses using PHP, that is a trade they want to enforce but can't or does not know how to do it. I am for a default with more things enforced and maybe only allowed them based on declares, not the other way around. Regards, Alex On Thu, Aug 29, 2019, 08:52 Zeev Suraski wrote: > On Wed, Aug 28, 2019 at 10:28 PM Matthew Brown > wrote: > > > Javascript has treated undefined variables as a catchable exceptions > since > > (I think?) forever. Perl is the only other language I know that allows > them. > > > > That isn't the point (I alluded to the fact that JS dealt with something > *similar* but not quite the same in my first mention of it). The point is > that when they wanted to make behavior around variables strict*er* than > what it was originally, they didn't simply change it - they added an opt-in > strict mode. > > I've written code in a lot of different languages. Many of those languages > > (most notably Standard ML) forced me to think about how exactly data > flowed > > through my program. PHP, on the other hand, doesn't demand anything like > as > > much work. This means its developers often don't improve much either, > which > > ultimately this harms the language's reputation as former PHP developers > > discover their bad habits don't translate well to other languages. > > > > With this change we can make it harder for people to write bad code, > which > > I think will result in existing PHP users becoming better developers. > > > > With this change we're taking away from people - including very informed > developers - the ability to use it as intended (one form of it that is). > There's a reason there's a wide selection of languages available, and that > different people have different language preferences. Personally, I can't > stand ML - and I find myself a lot more productive in other languages. But > I'm not going to campaign to change ML into something different because it > doesn't fit my programming/thinking style. > > Granted - PHP is orders of magnitude more popular and widely used than ML, > and we need to figure out ways to make this huge audience content - > including many who aren't happy with its behavior (whether it's because > they made an uninformed decision choosing it, or because it wasn't their > choice at all, or because they actually do like the language and would be > happy to use it if only it had X, Y and Z). But it shouldn't be at the > expense of others. Exactly like Perl and JS did it when they decided to > offer a stricter execution model. > > Zeev > --0000000000000a24f105913b882b--