7 ms·
But the source character set remains implementation-defined, so compilers do not have to directly support unicode names, only the escape notation. Definitely a
by dgrunwald 1y ago
But the source character set remains implementation-defined, so compilers do not have to directly support unicode names, only the escape notation.
Definitely a questionable choice to throw off readers with unicode weirdness in the very first code example.
- qsort 1y agoIf it were up to me, anything outside the basic character set in a source file would be a syntax error, I'm simply reporting what the spec says.
- ncruces 1y agoI use unicode for math in comments, and think makes certain complicated formulas far more readable.
- kzrdude 1y agoI've just been learning pinyin notation, so now i think the variable řₚ should have a value that first goes down a bit and then up.
- zelphirkalt 1y agoI am not sure it is a good idea to mix such specific phonetic script ideas about diacritic marks with the behavior of the program over time. Even considering the shape, it does not align with the idea of first down a little, then up a lot.
- kzrdude 1y agoTo be sure, it's a joke. Mostly trying to joke at the expense of these excessively complicated variable names (that are only there because it's pseudocode) :) And yeah, the chinese tone in practice does not align with the idea of "down a little up a lot" either. It depends on context...
- guipsp 1y agoWhat a "basic character set" is depends on locale
- qsort 1y agohttps://en.cppreference.com/w/c/language/charset.html https://en.cppreference.com/w/c/language/charset.html
- account42 1y agoAnything except US-ASCII in source code outside comments and string constants should be a syntax error.
- guipsp 1y agoYou are aware other languages exist? Some of which don't even use the Latin script?
- Y_Y 1y agoWhat; like APL‽
- nottorp 1y agoDunno about the OP but I'm very aware as I'm not an english speaker. I still don't want anything as unpredictable as Unicode in my code. How many different encodings will display as the same variable name and how is the compiler supposed to decide? If you're thinking of comments and user facing strings, the OP already excluded those.
- cryptonector 1y agoThe language and compiler & linker should reject Zalgo in identifiers, and they should reject confusable script mixes in identifiers, but otherwise they treat all equivalent strings as equivalent. To make it easier on the linker compilers should normalize all symbols to one common form (e.g., NFC).
- 1y ago