I always wonder why PHP never seems to favour making breaking changes to keep things cleaner, if you aren't going to improve language constructs in a major version, when will they be cleaned up?
I think that post Python 3 nobody is going to do that. It would be interesting to see a fork which removed all the crud though. Something that was easy to use for the person doing occaisional web work or beginner but without the traps and pitfalls.
Named arguments are coming in PHP 8
41–50 of 140 posts
Re: Named arguments are coming in PHP 8
#42Earlier quoted context omitted.
I think that post Python 3 nobody is going to do that. It would be interesting to see a fork which removed all the crud though. Something that was easy to use for the person doing occaisional web work or beginner but without the traps and pitfalls.
Python 3 attempted too much change at once. The Python folks could have spread incremental rollout of the changes across several major version numbers and probably not have faced such slow adoption.
Re: Named arguments are coming in PHP 8
#43Re: Named arguments are coming in PHP 8
#44I'm ambivalent. There's a tension in PHP-land between PHP's roots as a low-ish level, get-it-done, hackish language, with its big standard library and simple scalar types, and the better-organized and quite vocal developers who want it to be more Java-like, with great big frameworks and many deeply-nested complex class hierarchies. Instead of unwieldy hobbyist-hacker balls of mud, you build enterprise-scale balls of…
> There's a tension in PHP-land between [...] hobbyist-hacker [vs] enterprise-scale IMO the same tension exists in Python. The hobbyist-hackers are using the language to write small-ish scripts, and the enterprise-scale developers are working on million-line codebases. Unfortunately for the hobbyist-hackers, at some point (perhaps when the BDFL started working at Dropbox), the focus of the language shifted from the f…
Re: Named arguments are coming in PHP 8
#45Re: Named arguments are coming in PHP 8
#46Re: Named arguments are coming in PHP 8
#47I always wonder why PHP never seems to favour making breaking changes to keep things cleaner, if you aren't going to improve language constructs in a major version, when will they be cleaned up?
Re: Named arguments are coming in PHP 8
#48Re: Named arguments are coming in PHP 8
#49Earlier quoted context omitted.
> and basically nobody does that anyway. That's it, I'm officially a nobody :-)
> leaves it up to the called function to sanity-check the input types instead of letting the compiler do it, and basically nobody does that anyway. You don’t check the input types?
Btw I don't always sanity check the parameters, mostly at the system edges only.
Re: Named arguments are coming in PHP 8
#50The fact it errors if you over supply the function arguments is a bit worrying Adding a key to an array shouldn't be a breaking change, if you over supply a function by position today PHP doesn't error
I'd argue that this it the worrying part. How often do you intentionally supply an extra argument, and how often is it an accident? I'd take the warning.