Ligatures in programming fonts: hell no (2019)
practicaltypography.com
Ligatures in programming fonts: hell no (2019)
1–10 of 201 posts
Re: Ligatures in programming fonts: hell no (2019)
#2Re: Ligatures in programming fonts: hell no (2019)
#3Much ado about nothing. It's a matter of personal taste. An actual ≠ has a low chance to sneak into the source code, even lower chance to somehow type it by hand. Either way, it would be a syntax error highlighted by any editor. I'd like my code to look nice and I accept the risks.
Minor issue mostly.
I tend to "no", but for no very good reason: Aesthetically they're lovely.
Re: Ligatures in programming fonts: hell no (2019)
#4Ideally, languages would support Unicode as well so you can mean what you say when you type—some folks will naturally prefer this to “keyboard-compatible” options and this should be fine (though ask many non-Anglophone users where the `$` key is and they won't be able to tell you). With Vim digraphs, Kitty unicode input, extra layers on a keyboard… there are many ways to tackle the ‘input hard’ problem. A good example of this is Dhall where Unicode is optional, but could be enforced with a built-in formatter option.
Re: Ligatures in programming fonts: hell no (2019)
#5Ligatures in programming fonts: hell no (2019) - https://news.ycombinator.com/item?id=29637876 - Dec 2021 (195 comments)
Ligatures in Programming Fonts: Hell No - https://news.ycombinator.com/item?id=19805053 - May 2019 (86 comments)
Ligatures in programming fonts - https://news.ycombinator.com/item?id=14830797 - July 2017 (82 comments)
Re: Ligatures in programming fonts: hell no (2019)
#6I've witness many a question after/during technical slides where the audience was confused by symbols. At a bare minimum, don't use ligatures in slides or blog posts or anything meant for a broad audience. Ideally, languages would support Unicode as well so you can mean what you say when you type—some folks will naturally prefer this to “keyboard-compatible” options and this should be fine (though ask many non-Anglop…
Re: Ligatures in programming fonts: hell no (2019)
#7Other than that, ligatures are great and I will never turn them off.
Re: Ligatures in programming fonts: hell no (2019)
#8Re: Ligatures in programming fonts: hell no (2019)
#9Re: Ligatures in programming fonts: hell no (2019)
#10Luckily I rarely share my code through pdf, but mostly through git. Therefore, that hypothetical beast will read the code through its own editor, so the risk is mostly avoided. There is still the risk that this beast might appear behind my shoulders, see the pretty symbols and start that process anyway, but I have no idea how often that might happen too. It's a weird thing that this beast can do such an elaborate process, but not ask a question about what the symbols are.
For better arguments, there's a long history of problems with programming languages that use non-ASCII symbols as default, and it has been considered a mistake.
That crazy idea of 'letters' that look alike and thus introduce bugs is much worse with unicode than ligatures:
>>> a = "hello world"
>>> b = "hеllо wоrld"
>>> a == b
False
Example from "Unicode text spoofer":
>This browser-based utility fakes regular characters in text and replaces them with Unicode characters from other alphabets. The text that you paste or enter in the input text area automatically gets all possible characters replaced with Unicode homoglyphs in the output. You can spoof letters, punctuation marks, spaces, and even insert zero-width spaces between individual symbols.Now imagine instead of doing this, you use hello_world as variable name. You can thus interleave use of different variables that look alike, and have really buggy code.
Last argument, which is the one most important to me. Typing <= or != is ugly as shit. That is not how these symbols are supposed to look like, it's just a practical kludge. Ligatures are a simple solution to have both, that do not require a revolutionary way to change programming languages, and only engage yourself. To share print screens of code without ligature maybe configure a second editor with another font. That does not sound really hard...