2 ms·
There are pleasant, non-awful ways of doing characters in programming languages that don't involve memorizing the hex codes for Unicode characters or weird keyb
by andolanra 15y ago
There are pleasant, non-awful ways of doing characters in programming languages that don't involve memorizing the hex codes for Unicode characters or weird keyboards. For example, the Fortress language has three representations—a pretty, LaTeX-ish image form with operator symbols and the like, a plain Unicode form, and an ASCII form; I am under the impression that you type it up in ASCII, and then it gets prettified for printing. I'm actually as I type procrastinating from writing some Agda code, and Agda also uses Unicode in its source (it is admittedly heavily tied to its emacs mode, and inputting characters is done by typing in the LaTeX character entity, which the mode converts to the Unicode equivalent.) Agda is still ASCII-tolerant, as well; for example, it understands both → and its ASCII equivalent -> as being an arrow.
The issue is, a lot of languages don't necessarily need this. In a close cousin of Haskell like Agda, it makes sense, because it's very much like writing mathematics on a page, so using Greek letters and operator symbols is expected and will be understood by Agda programmers, especially if there's an assumption that it will be widely printed or read, as Fortress would be. But I honestly can't look at C++ and say, "Oh, it would be almost infinitely better if everyone updated their compilers so I could overload the × operator! That's exactly what I want—to be forced to use a Unicode terminal font so I can read source code over SSH!"