Re: Allowing NULL for some internal functions
| From: | Larry Garfield | Date: | Mon, 28 Feb 2022 17:35:06 +0000 |
| Subject: | Re: Allowing NULL for some internal functions | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-117165@lists.php.net to get a copy of this message | ||
On Mon, Feb 28, 2022, at 5:28 AM, Mark Randall wrote:
> On 28/02/2022 01:46, Craig Francis wrote:
>> Personally I think
strict_types=1 is fine for my code, but
>> I would never
>> want to force that style on everyone, because doing so would be fairly
>> hostile for a language that's popular and well known for being easy to
>> use/learn.
>
> Magically coercing things and hiding things under the hood is useful for
> the first 10 minutes of learning.
>
> After that it just becomes a hindrance difficult because you have to
> know all of the secret rules about type juggling.
This needs to be called out more. "Easy to learn" doesn't come from being forgiving
of sloppiness. It comes from making the non-sloppy approach straightforward, obvious, and if
someone does do something sloppy the error message(s) point people toward doing it the right way.
Forgiving of sloppiness is how you gt security errors, not ease of use.
--Larry Garfield