Den 2016-01-16 kl. 02:40, skrev Andrea Faulds:
Hi Thomas,
Thomas Punt wrote:
Hi internals!
Voting has opened for the inclusion of a digit separator in PHP[1].
Voting ends in
one week's time on January 20th.
Thanks,
Tom
[1]: http://wiki.php.net/rfc/number_format_separator
Initially I was going to abstain from this vote, but I've changed my
mind and I am now voting in favour of the RFC.
When choosing whether to add features to the language, we must set a
high standard, because every new additions means additional complexity
and more knowledge PHP developers have to have. So, every new addition
should be made to fit well with existing features, be useful, and
This feature offers some benefit in some cases. It doesn't introduce
much new complexity. There's no new syntax or tokens, it just modifies
the form of the existing number tokens. It fits in well what's already
there, consistently applying to all number literals. It follows
established convention in other languages. Its appearance at least
hints that values with these seperators are not constants or
identifiers, but numbers, reducing potential for confusion. It limits
its own application to prevent abuse (no leading, trailing, or
repeated separators). And it's relatively intuitive.
So I think it might be worth adding, thus my vote. Though we must be
conservative with additions, this one doesn't seem to be too problematic.
That said, I might be voting the wrong way. The feature does seem to
have limited applicability. That's really the only thing I can say
against it.
Thanks.
One could add that for programmers coming from another language
using _ as number separator there is a value in having the same
functionality. No need to relearn at all...
Came to think on license keys for games. They always have a separator
(using -) to increase readability. Which leads me to thinking, could the
proposed number separator be used in cryptographic keys and is there
a value in that?
Regards //Björn
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php