Re: A plea for unity on scalar types
| From: | Peter van Fessem | Date: | Sun, 15 Mar 2015 16:45:13 +0000 |
| Subject: | Re: A plea for unity on scalar types | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-84851@lists.php.net to get a copy of this message | ||
On 03/15/2015 03:49 AM, Dennis Birkholz wrote:
Hi together, Am 14.03.2015 um 14:37 schrieb Peter van Fessem:I don't think we disagree on this. I was only trying to say that both ini settings and declare statements influence behavior of other code, and that in both cases you have to put some effort into looking up the current value, but that is where the comparison ends.that is simply not true. The principle is not the same. The principle is roughly the same as with namespaces. If you are unsure, got to the top of the file, finished. Ini-Settings are runtime-dependent so there is no way to find out what the ini-setting will be beforehand.If a dev turns a file that he or she wrote into strict mode, then that only counts for that specific file. If you take over some code, then you can remove the declare line. *none* of those things you'd be able to do with ini settings. So don't shout out that nonsense FUD.It's equivalent to an ini setting in that it changes the behavior of the code based on something that is declared elsewhere. Obviously a declare statement in the top of the file is a lot better than an ini setting, but I think the principle is the same.
I think nobody will argue that namespaces are to complicated because you can define the current namespace at the top of a file which than changes the behavior of the file completely (which it does, somehow, by the way).I'd never argue that namespaces are complicated, but they, like every language feature, add a non zero complication to the language, whether you would use them yourself or not. Looking at the top of the file isn't a massive problem, but it is a small one. If I didn't see the value in namespaces, I'd prefer not to have them in the language at all (but I do, so I don't). I'm arguing against statements like: "Well if you don't like strict mode, don't use it.". It's not that simple. The fact that it exists adds a cost.
Greets DennisThanks, Peter