Thanks for your feedback. I really appreciate it. I'd like to add some thoughts to this, though:
First, one billion is 9 zeros in American and British English nowadays (short scale definition). This is sometimes confusing as it's 12 zeros in some other countries (long scale definition). For example, in Germany, we have Million (6 zeros), Milliarde (9 zeros) and Billion (12 zeros). As we have an english-speaking audience here, I've chosen to ignore my country's default definition and used 9 zeros. Also, you usually use English for code.
Second, you are right, you could use the e-notation. In this case, it would've been:
constoneBillion=1e9;// short scale definition
However, it's important to note that you are just adding zeros here. It's not so useful for other numbers.
Third, I feel like the numeric separator is still a very useful thing. As I said, the e-notation can be used, if you have to add zeros. Then, maybe it's easier. Nevertheless, the numeric separator has other uses as well:
So, it might not be the right thing to use everytime. Yet, I'd like to highlight that nothing is set in stone and there are always exceptions and different opinions on how to structure and write clean code.
I totally agree that _ has its uses and can make code much more reasonable in cases where e-notation wouldn't do so. But for the specific case of having lots of 0s, I'd always prefer the e-notation, because you can just read the number of zeroes. Something like 1e32 would be difficult to count even with _-notation.
Thanks for your feedback. I really appreciate it. I'd like to add some thoughts to this, though:
First, one billion is 9 zeros in American and British English nowadays (short scale definition). This is sometimes confusing as it's 12 zeros in some other countries (long scale definition). For example, in Germany, we have Million (6 zeros), Milliarde (9 zeros) and Billion (12 zeros). As we have an english-speaking audience here, I've chosen to ignore my country's default definition and used 9 zeros. Also, you usually use English for code.
Second, you are right, you could use the
e
-notation. In this case, it would've been:However, it's important to note that you are just adding zeros here. It's not so useful for other numbers.
Third, I feel like the numeric separator is still a very useful thing. As I said, the
e
-notation can be used, if you have to add zeros. Then, maybe it's easier. Nevertheless, the numeric separator has other uses as well:So, it might not be the right thing to use everytime. Yet, I'd like to highlight that nothing is set in stone and there are always exceptions and different opinions on how to structure and write clean code.
I totally agree that
_
has its uses and can make code much more reasonable in cases wheree
-notation wouldn't do so. But for the specific case of having lots of0
s, I'd always prefer thee
-notation, because you can just read the number of zeroes. Something like1e32
would be difficult to count even with_
-notation.true
. I agree. Maybe next time, I should choose a different example. Thanks for your input, though.