Re: Revive Number Format Separator RFC
| From: | Bishop Bettini | Date: | Mon, 29 Apr 2019 07:33:03 +0000 |
| Subject: | Re: Revive Number Format Separator RFC | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-105497@lists.php.net to get a copy of this message | ||
On Sun, Apr 28, 2019 at 1:47 PM Theodore Brown <theodorejb@outlook.com>
wrote:
> On Sat, Apr 27, 2019 at 10:25 PM Stanislav Malyshev <smalyshev@gmail.com>
> wrote:
>
> > I am not exactly against this feature, but the potential for abuse
> > \- like enabling people using integers for things that are not
> > integers and should not be stored as integers - worries me now.
>
> Based on the usage analysis Bishop did, people already use integers
> for number-like values (e.g. phone and social security numbers) that
> can be better represented in other ways.
>
> Perhaps adding the numeric separator feature can actually be an
> opportunity to discourage such misuse. We can add a paragraph to the
> RFC (and the documentation if it is accepted) that lists examples of
> usage that should be avoided.
>
> Ultimately there remains many legitimate uses of large numbers in
> code (e.g. scientific constants, unit test values, business logic
> thresholds, etc.), and this feature is a simple way to improve their
> readability.
>
> I've lost count of the number of times I've been debugging a failing
> test and struggling to count the number and position of digits to
> make sure I have the right value. This feature would save time when
> reading code and indeed prevent a lot of mistakes in the first place.
>
Well said.
One need not agree with an implementation to appreciate the improved
readability.
If you'd like to re-open this for voting, I'm able to assist with the RFC
process and any code changes.