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 <z...@php.net> wrote:

> On Wed, Aug 28, 2019 at 10:28 PM Matthew Brown <matthewmatt...@gmail.com>
> 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
>

Reply via email to