Re: Re: [RFC] Numeric Literal Separator
| From: | G. P. B. | Date: | Wed, 29 May 2019 11:34:58 +0000 |
| Subject: | Re: Re: [RFC] Numeric Literal Separator | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-105794@lists.php.net to get a copy of this message | ||
I share the same concerns as Rowan Collins, and I'm really not a fan of the
RFC in general.
Also I think those kind of magic numbers should be constants with
meaningful names, and it that case you could just compute them by adding
powers of ten.
E.g. DISCOUNT_IN_CENTS = 1 * 10^5 + 3 * 10^4 + 5 * 10^3;
Now I'm assuming opcache would compile this into a final integer but I may
be wrong on how the internals of the engine work in this case.
Moreover I feel that people may misread numbers like that if people use
different groupings.
E.g. 1_0000_0000_0000; by skimming rapidly I could think it's a
billion(10^6) when in reality it's a trillion (10^9).
Even if maybe some countries are moving away from the grouping digits in
groups of 4.
I'll probably vote against it but that's only my opinion.
George P. Banyard