|
|
|
|
|
by beagle3
1646 days ago
|
|
Keywords are in English, and 99% of identifiers in all code I met are too, even when comments are in French or russian. Pascal and old basic (among other languages) have been case insensitive for decades, and that has not been a problem. In UI, you are by all means correct. But code is a formal language that happens to be expressed in Latin letters. APL is the only real language that doesn’t impose a western character set. |
|
... because back then Unicode was still a pipe dream in the mind of some visionary. Everything used 8 bit encoding, and everyone assumed ASCII or at least something compatible with the 7 bit subset of ASCII.
Nowadays files are formatted in UTF-8, and most modern languages actually fully support UTF-8 identifiers. Nim itself supports UTF-8 "letters" in identifiers, and what is "upper case" or "lower case" 100% depends from the current locale. Restricting your case normalization logic to ASCII is __really bad__, because it basically means that non-Latin letters in identifiers won't be normalized, with possibly unexpected consequences.
> APL is the only real language that doesn’t impose a western character set.
- Rust uses UTF-8: https://doc.rust-lang.org/reference/identifiers.html
- Go allows any Unicode letter in identifiers: https://go.dev/ref/spec#Identifiers
- Swift is also famous for allowing you to use emojis in identifiers.
- Python supports non-ASCII identifiers: https://www.python.org/dev/peps/pep-3131/
And the list goes on. Even C++ can optionally support Unicode in identifiers (for instance, Clang and GCC do indeed support things like `constexpr auto 黒 { "lol" };`).