13 ms·
The best thing about using only ASCII for the main syntax is that everyone can type it with their keyboard. I think the recent fad of supporting Unicode identif
by eterevsky 5y ago
The best thing about using only ASCII for the main syntax is that everyone can type it with their keyboard. I think the recent fad of supporting Unicode identifiers is misguided. Of course, Unicode should be permitted in string literals, but not in the code itself.
*Also I don't think Go is better than modern C++, though it might be better than C++99 which was the main standard when the article was written.
- wutwutwutwut 5y ago> The best thing about using only ASCII for the main syntax is that everyone can type it with their keyboard. My keyboard doesn't have a key for NUL, BEL, VT, EOT. What kind of keyboard do you have which has buttons for these?
- zabzonk 5y agoWith vim at least, you can type them in as control-key sequences (preceded by Ctrl-V).
- wutwutwutwut 5y agoBut then the statement is incorrect. I can write all of Unicode using keyboard sequences as well. People from US seems to have a strong fetishes with ASCII.
- hnfong 5y agoASCII is an abbreviation for American Standard Code for Information Interchange after all.
- eterevsky 5y agoLet's not be so pedantic. I meant visible ASCII symbols, character codes 32-126 plus newline.
- wutwutwutwut 5y agoPlease start with not making incorrect statements. If you mean something else than what you write, then write what you mean instead.
- deleted 5y ago[deleted]
- sharikous 5y agoHaving to do math and physics heavy work, I very much support the "fad" of having Unicode literals. "omega_0" is much worse than "ω_0" especially if you have tons of these variables. If you don't do math it's difficult to understand, but try writing without the alphabet and expressing the same concepts. Possible but clunky
- azalemeth 5y agoI respectfully disagree with this. I do a lot of maths-heavy work, but for me in languages (not Julia!) being able to quickly write the LaTeX names for symbols is more than enough. It's also much quicker, and easier to search for when reading someone elses' code. I personally find it also helpful to make the distinction between the maths and its implementation, though I accept that others would vehemently disagree iwth me.
- vicek22 5y agoMaybe there could be a middle ground. For math-heavy applications, the editor could implement ligatures same as Fira-Code and the latex name would render as the symbol until you put a cursor on it.
- IlliOnato 5y agoIt makes it easy to type, but does it make it easy to read/maintain? As they say, it's already way too easier to write code than to read it. A programmer should make every effort to make code more readable. An editor should make it relatively easy to enter special symbols (especially if you can specify a limited set); it is totally solvable problem. An editor can only help you so far with reading code...
- kaba0 5y agoI believe it is most definitely easier to read/maintain -- restricted to that small domain-specific function. Some greek letters have very specific meanings, replacing them with long-ass names straight up worsens readability. Writing out density, velocityX, etc will quickly fade the core logic of that function.
- zabzonk 5y agoSlight typo: It's C++98.
- eterevsky 5y agoThanks! I confused it with C99.
- benjaminjosephw 5y agoBut "everyone" doesn't have the same keyboard nor does everyone speak the same language. ASCII is not a universal character set and treating it as such is nothing short of cultural imperialism: "If it's good enough for us, it's good enough for everyone". Artificial limits on language and characters sets might sound simple to you but it introduces a lot of complexity for others. Unicode code solves that problem with not too much overhead. Also, just to point out, this assumption is exactly why diversity in tech matters so much.
- doctor_eval 5y agoNot sure why you're downvoted; it's simply true that ASCII is not universal. The "A" in ASCII stands for American. I am a monolingual English speaker but I think I should be able to write ÷, ≤ and ≥ in my Go code, and I think I should be able to do maths using π.
- deleted 5y ago[deleted]
- sokoloff 5y agoGiven that the go community does not seem to hold this as a majority opinion, you might consider whether an editor translation layer could allow you to tailor your environment to your preferences while maintaining source-level compatibility with the broader go community. If compatibility is not as important to you, privately forking the language is also an option, but that seems fraught with peril of your code dying with you.
- doctor_eval 5y agoGoLand actually does this. But the point is not my preference to use the actual, proper symbols, but rather the technically unnecessary decision forced upon me that says I cannot.
- layer8 5y ago> The "A" in ASCII stands for American. Just call it ISO 646-IRV instead. ;)
- II2II 5y agoOverall, Unicode is a good idea. That said, languages should limit themselves to a subset of Unicode to avoid the use of glyphs that look too similar or that have too much variation (e.g. emoji).