Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106990 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 3494 invoked from network); 12 Sep 2019 20:16:15 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by pb1.pair.com with SMTP; 12 Sep 2019 20:16:15 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id AD0C02D1FCF for ; Thu, 12 Sep 2019 10:52:11 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp3.php.net X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Virus: No Received: from mail-vs1-xe2f.google.com (mail-vs1-xe2f.google.com [IPv6:2607:f8b0:4864:20::e2f]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp3.php.net (Postfix) with ESMTPS for ; Thu, 12 Sep 2019 10:52:11 -0700 (PDT) Received: by mail-vs1-xe2f.google.com with SMTP id z14so16767657vsz.13 for ; Thu, 12 Sep 2019 10:52:11 -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=MnDEQ4R3qg2ML333A80zfUO8qtqT3U1wxTHD17Gdv1U=; b=EuYB7geKVvBKxrJahEXIA0llUyIfROHU4VL82j6KorL3LzEX/Ich7UYiJT65tjmEv1 s5mWJVBKodDuwctC7yGQIlXndhnZ5Ec2fK92ePlxW/XjwMMfl6MVvE+xyYH8Ca4SzoVS AfD7mS5K+Da8G6dRRMmqY1p+4P7oNphTiO0vfreGj5AF0dCK2rhPgpTLgi7pGKT1c4Y6 cJ1t5BF8J8LNCB87IonhtKuhfxVM2Jps34F+lKh5OkEjhMQBOIccmlQuOv6pNxwZIFDY QsB7Cuh9GLELIPf2F56CMzpPtDVwFQWe2KWE9W0f7m3pRw+u1yVvEBj23muAB5VDFRZH Fjow== 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=MnDEQ4R3qg2ML333A80zfUO8qtqT3U1wxTHD17Gdv1U=; b=Ee+pE6mbztfLjovaTJkjJl8Qlr8uhx9xFsaSu3gN9IrUFGuMwrJGkpdrHeUIfvI8bn Rw5M6QxA9oBmjMZ9ZDWFZvmsL/x0zlmSmoB3wRg+J2X3K9NTqxlnZ8d+xyOTxxaXIvlA 02r+Qh06E0nD17LIXyxlmT8Nug6WH5VGDmx9NG8UoW1B7ce0lWAohayHYv1dHY+6U3t8 ZNIriaJSiy4Gt+uvX8WNKPM3ForvUsUL2FRAxsuzQEsiqpGBUPY8cIMFPxKfEVIDI5lY UHjwko9EA9f/Ivtr4flanfNUG7OLLVXkHQrmeATsQ1PM8HHMAwo+4aahVtG12kBNZrl0 FRhg== X-Gm-Message-State: APjAAAUt4tULD50RDMwXnN4JxL6mNQcJc6/bH40QB+XLPzL+ez9ZJq2X ZXtCV0wLUW2BATUQKaxvVExdLhd4u3Z1F4E8Ezs= X-Google-Smtp-Source: APXvYqyT7wjPImEVvevw/dbQqXYcPzNFLrj6P3ApPu2tp/oQ8LWKnYzyVvUFcoLg8BvgtaomYenpbUseVuTDtYngqxk= X-Received: by 2002:a67:ec14:: with SMTP id d20mr24019208vso.209.1568310731042; Thu, 12 Sep 2019 10:52:11 -0700 (PDT) MIME-Version: 1.0 References: <076701d56978$86020910$92061b30$@php.net> <078e01d5697c$5512bc10$ff383430$@php.net> In-Reply-To: Date: Thu, 12 Sep 2019 13:51:59 -0400 Message-ID: To: Olumide Samson Cc: Matthew Brown , Scott Arciszewski , Zeev Suraski , Marco Pivetta , PHP Internals List Content-Type: multipart/alternative; boundary="000000000000057a0c05925ecc5b" X-Envelope-From: Subject: Re: [PHP-DEV] Changing fundamental language behaviors From: chasepeeler@gmail.com (Chase Peeler) --000000000000057a0c05925ecc5b Content-Type: text/plain; charset="UTF-8" On Thu, Sep 12, 2019 at 1:39 PM Olumide Samson wrote: > > > On Thu, Sep 12, 2019 at 6:22 PM Chase Peeler > wrote: > >> On Thu, Sep 12, 2019 at 1:05 PM Matthew Brown >> wrote: >> >> > that don't fundamentally change the language >> > >> > >> > There's clearly a big disagreement about whether this is a fundamental >> > change or not. >> > >> > Preventing something that the entire field of software engineering >> frowns >> > upon (and that most PHP developers avoid like the plague) doesn't seem >> like >> > a *fundamental* change. >> > >> > >> I would argue that this is exactly such a change. The flexibility of PHP >> has often been touted as a feature and something that sets it apart. >> Whether that's good or bad is, frankly, irrelevant. There are valid >> reasons >> for not always initializing variables or array keys. > > The major valid reason i see is creating a bolierplate or being lazy to > initialize the variable with even null or similar null-type depending on > its context. > > It might be a bad reason in your opinion, but others view it as perfectly >> acceptable. > > Who are those "others"? > I think he(me included) is also one of those "others" that view it as bad > programming style... > > For 20 years people have developed code based on that feature. It was never >> considered an error, and often not even considered bad practice. > > It was considered an error, that's why you were been warned or given > notice that "Hey dude, you're writing a bad code here @ line 1427(l4zy) of > already-problematic-file.php" and only if we want to remove Notice,Warning > or Error in the language. > No, as discussed previously, notices were never meant to signify a definite issue. They are "Hey, this might be an issue, it might not, maybe check it out if you want?" thing. This RFC is proposing that we actually halt execution of programs that currently work perfectly fine and run exactly as they were intended to. > To suddenly define it as such is the exact definition of a fundamental >> change >> to the language itself. >> > Fundamental is always "fundamental", i think there's no good definition > for it in this context, so leave fundamental changes out of this discussion > as something totally bad been cleaned up is a fundamental change and > something new but not used right and changed to be used right is also > fundamental... > I would said fundamental is any behavior that is expected and intended. At this point, the fact that you don't have to initialize your variables is an intended feature of the language. That means people should be able to depend on such a feature existing. The fact that you don't like it shouldn't be a justification for breaking that, especially when nothing is stopping you from being as strict as you want with your own code. You can also hold any third party libraries that you use to the same standard if you want. > >> What if Java suddenly said that all properties are suddenly private, and >> can only be accessed through getter/setter methods? The fact that you >> should make properties private and use such methods is a practice that was >> drilled into me from day one. Would that justify making such a change, >> though? >> >> I'm not sure how this relates, i think Java would let you see the good or > bad, it's up to you to see or not from their view, let the majority move > forward and don't be a stopping stone in moving this language past the 1993 > bondage(needle-haystack, inconsistent naming and many issues we couldn't > count)... > It relates because right now, it's a feature of Java that you can make properties public and then modify those directly from outside the class. Since it's an intended feature, a lot of people have written code that directly accesses public properties.You could argue the only use-case for doing so is that they are too lazy to write the getter/setter methods, but that doesn't change the fact that such code exists and is not an error or even a misuse of a current feature. -- Chase Peeler chasepeeler@gmail.com --000000000000057a0c05925ecc5b--