proposal-decimal
proposal-decimal copied to clipboard
The syntax clashes with the International System of Units
The vast majority of earth's population will have grown up with the metre as the dominant unit of length and will interpret 1.5m as a length. Granted, not every one of them is a programmer and any competent programmer can reprogram her or his brain to codeswitch, interpreting familiar expressions in a new and completely context. Still, it is a mental papercut and unnecessary mental weight, one of those which are most harmful to new and beginning programmers and follows a non-internationalisation bias like the unfortunate use of the diacritical accent grave for template strings.
If it must be a suffix consisting of a letter beyond g – why not a p, standing for precision?
Ah, that's a good point, I didn't think about this. Sure, why not p? Or, any other ideas?
Skimming through the README for the first time, I was also confused at 1m + tax. 1p definitely looks better to me too, as similar notations (1f in C, 1n in JS) don't bring any existing common SI unit to mind.
Fun issue but true. Another possible notation: n - Natural r - Real
I remembered about C hex float literals today (e.g. 0x1.ffffp+3) and so maybe we should avoid p in case JS wanted to add that notation in the future.