proposal-decimal icon indicating copy to clipboard operation
proposal-decimal copied to clipboard

The syntax clashes with the International System of Units

Open ttepasse opened this issue 5 years ago • 4 comments

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?

ttepasse avatar May 30 '20 00:05 ttepasse

Ah, that's a good point, I didn't think about this. Sure, why not p? Or, any other ideas?

littledan avatar Jun 09 '20 18:06 littledan

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.

lazarljubenovic avatar Dec 05 '20 12:12 lazarljubenovic

Fun issue but true. Another possible notation: n - Natural r - Real

munrocket avatar Dec 12 '20 00:12 munrocket

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.

ptomato avatar Jan 19 '22 19:01 ptomato