Hacker News new | ask | show | jobs
by tyingq 1672 days ago
Yeah, that's a terrible example since some places do use comma as a dollars/cents separator, and others don't. And some people use floats for currency (with the obvious caveats), and might read this as "_ is the same as a decimal point".

They really should just use a simpler example, like 10_000_000 being easier to read as "10 million" than 10000000.

1 comments

  > They really should just use a simpler example, like 10_000_000 being easier to read as "10 million" than 10000000.
Declarations such as `$million = 1000 * 1000;` or `$seconds_in_day = 24 * 3600;` are very common, and in my opinion more readable than the ignored-underscore syntax.
Perhaps, though the underscore syntax works in Perl, Ruby, Java, etc.

And the context here is how to explain it, not whether it should exist and/or be used.