Rant: Why no commas?

1 points by mchahn ↗ HN
I have been using computers for many years and I always assumed output would become easier to read. But I still see numbers like 69882139 everywhere. How am I supposed to know if it is approximately 7e6, 7e7, or 7e8? What is wrong with showing 69,882,139 or 69.882.139? And why don't all languages allow this syntax in constants? It is just as hard to type it in correctly as it is to read it.

2 comments

[ 2.9 ms ] story [ 12.6 ms ] thread
Lately I noticed that Ruby and Java both permit underscore in numeric literals.

As to why it wasn't there before, or why it isn't available everywhere, I'm not sure, but I suspect the answer is basically lexing/parsing difficulties.

I can tell you what's wrong with 35,798: it's less than fifty, even if you don't parse it that way.

But as b6 said, some languages support grouping of digits, but they use another symbol, usually _.

Ada would be an example.