Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:107039 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 30744 invoked from network); 13 Sep 2019 02:27:14 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by pb1.pair.com with SMTP; 13 Sep 2019 02:27:14 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id 2A1B02D2011 for ; Thu, 12 Sep 2019 17:03:15 -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=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,FREEMAIL_REPLY,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-oi1-x244.google.com (mail-oi1-x244.google.com [IPv6:2607:f8b0:4864:20::244]) (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 17:03:14 -0700 (PDT) Received: by mail-oi1-x244.google.com with SMTP id w17so746854oiw.8 for ; Thu, 12 Sep 2019 17:03:14 -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=bg4MFU/EKbiXRKu9hXjozq/vS5NPkR7tu7LX+LYchaU=; b=MVCm/7v2A2c13vext/NhBJOjN1F0NLo3ci7+RWMfFH0wkGf1LJA1eHt6JIimBXc9ay MlFhp079hZCLglcwU2cu0yOrp2SWqSZP/h3EPsv3m+pTLA/KUU5hSLWxPsCM4R480x87 sDC14vj9cnd2lwwrMyCkZxNugN81CRNMUjEgX9cZMvOjSaf3yHLFjFiicYixISM58q3k 6InJem/YpfNazIoOyMlOGm7OjL+p36MYJ0E2l7KljkPVVQc509xwpi0CJkkdZ4Hmjt9n 0nS1pOp309Nnt4Y+nsKF45FKN4SZg665Z7vF6NPOQGFzS+1us+2CS6bpxJs0LtNT6ORP HsDw== 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=bg4MFU/EKbiXRKu9hXjozq/vS5NPkR7tu7LX+LYchaU=; b=NuMneK7RQ/G+SIQqlMSqb5Lw4PIMCqq9mO/Ul2m3CkB4EJPZEZ+u+9a/qg8QRPUDm/ DKx4YUrl7iysqp5sROPC7ab3Udd12HUNUUYwdLcBXtNWfuZn7xWHGlaJ46L8p9amDHK+ kd207uQh6lC2wG1uh30+uRjIuA2pFk2TXamaq77O25TSMOO6p5X6BCDaeg1tGq+ZcBsI CsW8woWZJJ2/C61yW09t3k+m++s/WuuvD4sy7Twc1OLpoK17Ih65T+DyhcDV2Y9JjsPH YGGQBzU4Tco568m2sxj/mNmGR8sILzMLrxr7M9fIvE/eCPmL7K3REL7Mdh87lZ/U6NX5 4TgA== X-Gm-Message-State: APjAAAWMuOGohN48wuZ1/ZFtpMOVsOo0ZvLJMs69LcAyWLoXbn4Y3/Hg BU+hHm4IbhsFAnD7j+vcRr/f9IG1PhgTs5lxUNw= X-Google-Smtp-Source: APXvYqxBqcq8B2/ugs8NVgxwkSJSN1fJruDZLxy6xOSAf3vcLjK1n5q2qrnnM9MbxG2iQf7OT0p0eci2AUimxNzVNWo= X-Received: by 2002:a05:6808:98a:: with SMTP id a10mr1185724oic.54.1568332993714; Thu, 12 Sep 2019 17:03:13 -0700 (PDT) MIME-Version: 1.0 References: <076701d56978$86020910$92061b30$@php.net> <467be4a0-dd8b-29d2-0b09-a3efd7fad56a@heigl.org> In-Reply-To: Date: Fri, 13 Sep 2019 01:03:00 +0100 Message-ID: To: Chase Peeler Cc: =?UTF-8?Q?Alexandru_P=C4=83tr=C4=83nescu?= , Michael Babker , Internals Content-Type: multipart/alternative; boundary="000000000000fae379059263fac0" X-Envelope-From: Subject: Re: [PHP-DEV] Changing fundamental language behaviors From: oludonsexy@gmail.com (Olumide Samson) --000000000000fae379059263fac0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Sep 12, 2019, 10:15 PM Chase Peeler wrote: > > > On Thu, Sep 12, 2019 at 4:59 PM Alexandru P=C4=83tr=C4=83nescu > wrote: > >> Hi guys, >> >> > Many of us don't consider it bad code. I've also always initialized >> > variables when it was required (and many times when it wasn't) even >> though >> > I wasn't forced to do so. A lot of other people do as well. If it's so >> > important to you, start a program to teach people how you think they >> should >> > code. >> >> One problem that needs to be understood is that PHP is used by a lot of >> users. >> Because it's easy to pick up and you have fast feedback it probably have >> a higher percentage of juniors than average. >> > > I don't think "new developers might do it wrong" is a very compelling > argument. We shouldn't handcuff the language because some people might us= e > the flexibility improperly. > > >> How language was 10 years ago it didn't helped them much in learning and >> they did lot of mistakes. Some of those mistakes cost companies lots of >> money and, in time, people got to the conclusion that PHP is bad. >> This is a very important thing!, Yes you can write working great code in >> PHP but it's very easy to write working bad code as well. And it's not >> about you and me or the other persons chatting here, it's about the rest= of >> the world. >> >> > And I don't think we should take away the flexibility that makes PHP grea= t > because some people don't use it correctly. "Billy can't code properly > unless the the application crashes whenever he doesn't initialize a > variable" isn't any more compelling when it's in the third person than it > was in the first person. > I hate to see people taking PHP dynamic bug-friendly pattern as great flexibility. Why would something be great and same time be bad? Isn't that a contradiction? PHP is great in flexibility for things like being dynamically typed, fast to launch(major hosts always have it enabled), easier to understand but not for allowing bugs that can cost huge money in the long run. PHP is a very good friendly language when it comes to learning, yet the worst language when it comes to ideology or roadmap. Most companies only prefer PHP to make fast MVP, but as soon as that stage passed, their HR would start searching for developers in other better languages. Check out stackoverflow and see how many buggy questions are asked daily. > > >> PHP improved on it's bad image in the later years but this needs to >> continue. IMO, one thing that we need to also do is to make the language >> image better. >> With this in mind, I believe the "undefined variable" error will be a >> step forward. >> >> > But it won't. People that won't a stricter language aren't going to start > using PHP because it suddenly throws more errors than it used to. As I > mentioned before, some non-PHP developers I knew find it appalling that > such a massive BC break was even being considered. As much as they don't > like the idea of uninitialized variables, the fact that they've been arou= nd > for 20 years and now there is talk of them making applications crash was > much bigger issue. > > The way we improve PHPs image is we show why the things that make it > unique are actually good things, while adding NEW features to the languag= e. > No matter how much we try to make PHP like Java, c#, python, etc., it isn= 't > going to entice those developers over to PHP when PHP doesn't offer them > anything different than what they already have. > > > >> It's not about if you don't consider it bad code and that apparently the >> majority consider it good. >> It's that if language wouldn't allow you to write that code it will >> benefit the language image and the rest of the PHP comunity. >> >> Also, I would also like to remind of this: >> https://github.com/php/php-src/blob/master/docs/mailinglist-rules.md >> I think some parts might have been violated multiple time in this thread= . >> >> > I can take the hint. This will likely be my last post on the topic. I > think there are few others on this thread that can take up the fight from > here on out. > > >> Regards, >> Alex >> >> >> On Thu, Sep 12, 2019 at 10:29 PM Chase Peeler >> wrote: >> >>> On Thu, Sep 12, 2019 at 3:17 PM Olumide Samson >>> wrote: >>> >>> > On Thu, Sep 12, 2019 at 8:11 PM Michael Babker < >>> michael.babker@gmail.com> >>> > wrote: >>> > >>> > > On Thu, Sep 12, 2019 at 2:06 PM Olumide Samson >> > >>> > > wrote: >>> > > >>> > >> On Thu, Sep 12, 2019 at 8:00 PM Michael Babker < >>> > michael.babker@gmail.com> >>> > >> wrote: >>> > >> >>> > >>> On Thu, Sep 12, 2019 at 1:51 PM Peter Kokot >>> > >>> wrote: >>> > >>> >>> > >>> > Just a dumb idea, since there clearly is a majority in favor of >>> the >>> > >>> > change with these warnings and strictness and all that now... >>> Why not >>> > >>> > making something like an LTS PHP 7.x where all the legacy code >>> would >>> > >>> > work OK as long as practically possible and 8.x+ would be the >>> future >>> > >>> > of what the developers want and not what business wants? One wh= o >>> > won't >>> > >>> > upgrade due to the BC breaks also won't need the new features >>> anyway >>> > >>> > very realistically. >>> > >>> > >>> > >>> >>> > >>> Please don't tie the notion of LTS with the idea that a new major >>> can >>> > >>> break >>> > >>> BC at will or create larger scale breaks because the previous >>> major has >>> > >>> extended support. Sooner or later that will end up back at the += + >>> idea >>> > >>> and >>> > >>> fragmentation encouraged by the language is a bad idea. >>> > >>> >>> > >> >>> > >> Not sure you are really seeing the goal... >>> > >> >>> > >> Why is LTS not a good idea? >>> > >> >>> > > >>> > > I'm not saying LTS is a bad idea. I'm saying using LTS to justify >>> > > shipping larger scale BC breaks, such as the changes suggested in t= he >>> > last >>> > > couple of "contentious" RFCs in a major version because "hey, we >>> have a >>> > LTS >>> > > version you can use that until you're ready to deal with the backlo= g >>> of >>> > BC >>> > > breaks created" is a bad idea. >>> > > >>> > >>> > >>> > > For the record, I happen to agree with as these RFCs would have >>> minimal >>> > > impact on my day-to-day work, but having also been in the role of a >>> > > maintainer of open source libraries and applications I also grasp w= hy >>> > these >>> > > types of changes can be problematic to the ecosystem (both end user= s >>> of >>> > > those libraries and applications and the maintainers of them) and >>> > wouldn't >>> > > jump the gun to ship them without careful consideration. >>> > > >>> > >>> > Most of these changes wouldn't have been problematic to you if the >>> language >>> > has prevented you from writing what we can now consider bad code, so >>> please >>> > allow the new PHP developer that newly start using PHP to not follow >>> that >>> > your path that will/might hunt him later in the future... >>> > >>> > >>> Many of us don't consider it bad code. I've also always initialized >>> variables when it was required (and many times when it wasn't) even >>> though >>> I wasn't forced to do so. A lot of other people do as well. If it's so >>> important to you, start a program to teach people how you think they >>> should >>> code. >>> >>> >>> > There a notices, warning and errors to inform you that this shouldn't >>> have >>> > been the use case of this feature and you chose to ignore it and now, >>> we >>> > are simplifying things and making those your errors teach you how to >>> write >>> > proper codes in the future, you're objecting.. >>> >>> >>> As has been discussed before, notices are not the same as warnings and >>> errors. Also, if those things are so wonderful, why can't you use them >>> to >>> catch the issues you are complaining you can't catch right now? Again, >>> you >>> are telling me there is something out there which will allow you to for= ce >>> yourself to write "good code" without forcing me to follow the same >>> restrictions. Yet, you still feel it's necessary to not use those tools= , >>> and instead modify the entire language so that I am forced to follow wh= at >>> you deem best practices, even if I don't? >>> >>> >>> >>> > Why not just stay in PHP 7.x? >>> > >>> > Because other features that I want to utilize will also be added in P= HP >>> 8. >>> >>> Or were you implying you want hitch-free, no-modification upgrade to PH= P >>> 8 >>> > from PHP 7.0? >>> > >>> >>> I never said that. Here we go again with the "I guess you are against a= ll >>> BC breaks" nonsense. If BC breaks are required to add new functionality= , >>> or, have a very minimal negative impact, then I don't have a problem wi= th >>> them. This is not one of those cases. It changes a fundamental aspect o= f >>> the language, an aspect that many people actually like, and it doesn't >>> add >>> any new features to the language, nor is it needed to add any new >>> features >>> to the language. >>> >>> >>> > If yes, follow the best practices and not suppress error notices. >>> > >>> > Just My Opinion >>> > >>> >>> >>> -- >>> Chase Peeler >>> chasepeeler@gmail.com >>> >> > > -- > Chase Peeler > chasepeeler@gmail.com > --000000000000fae379059263fac0--