Re: [RFC] Reclassifying engine warnings
| From: | Rowan Tommins | Date: | Thu, 12 Sep 2019 20:59:41 +0000 |
| Subject: | Re: [RFC] Reclassifying engine warnings | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-107020@lists.php.net to get a copy of this message | ||
On 12/09/2019 15:13, Nikita Popov wrote:
FTR this is basically what Python does via defaultdict: https://docs.python.org/3/library/collections.html#collections.defaultdictThanks, I'm glad I wasn't completely daft thinking there might be some way to express it. :)
I think it is the "cleanest" solution to this problem overall. Though it does need a separate structure, rather than our favorite PHP array.Indeed it does, and I think that's the better route to making PHP a stricter language: before we take away the existing features, add the new ones that let you express things better. PHP's array type, and its type system in general, allow a lot of very expressive algorithms which are hard to do with more rigid type systems. Modern languages like C# bring back that expressiveness using things like generics, a rich library of built-in collections and interfaces, and so on; they don't just say "sorry, you can't do that". Regards, -- Rowan Tommins (né Collins) [IMSoP]