a) comma has already defined meaning so it could be ambiguous - it would mean tuple (2,333) in python for example
b) even if its not the case, its easy to confuse it with floats, and you do not want apply local numerical conventions to code and discover one day that all your ints are floats because some setting was different
c) you can write it as 2_333 in growing number of languages
Oh yeah, let's have more of the ambiguity that CSVs have: is it a comma between arguments? Is it a decimal comma? Is it a thousands separator? Is my locale correct for parsing this? What was the author's intended and actual locale?
On the other hand, what improvement does this bring? ... "it is supposed to look pretty."
depending on intent. I mean the requirement of a common as a separator seems superfluous -- particularly in languages like Python which rely heavily on semantic whitespace.
In C++1y/C++14, you can use the apostrophe. i.e. 2'333
They took a backward compatible approach by using a symbol that's not already used for other operations, like "," or "." or ";" The grammar would be non-trivial or too restricted otherwise, IMO.
[+] [-] fiedzia|9 years ago|reply
a) comma has already defined meaning so it could be ambiguous - it would mean tuple (2,333) in python for example
b) even if its not the case, its easy to confuse it with floats, and you do not want apply local numerical conventions to code and discover one day that all your ints are floats because some setting was different
c) you can write it as 2_333 in growing number of languages
[+] [-] Piskvorrr|9 years ago|reply
On the other hand, what improvement does this bring? ... "it is supposed to look pretty."
[+] [-] CarolineW|9 years ago|reply
What are its parameters?
[+] [-] brudgers|9 years ago|reply
[+] [-] mailslot|9 years ago|reply
They took a backward compatible approach by using a symbol that's not already used for other operations, like "," or "." or ";" The grammar would be non-trivial or too restricted otherwise, IMO.
[+] [-] bengunnink|9 years ago|reply
[+] [-] bjourne|9 years ago|reply
[+] [-] svisser|9 years ago|reply
1_000_000
https://www.python.org/dev/peps/pep-0515/