4 ms·
A ligature is more functional than not using one. They obscure the code for about 5 seconds the first time you see them, and then never again. After those 5 sec
by blindmute 5y ago
A ligature is more functional than not using one. They obscure the code for about 5 seconds the first time you see them, and then never again. After those 5 seconds, you register a new semantic symbol in the brain. It is objectively easier for your brain to parse a single arrow symbol than it is to parse => in a monospace font. For the latter, you are scanning two symbols and only after seeing them both can your brain put them together into a semantic meaning. This is strictly worse than just seeing an arrow symbol and understanding it is an arrow.
- smoldesu 5y agoIf this wasn't a discussion about monospace fonts, I might be inclined to agree with you. However, I kinda agree with the detractors here; ligatures objectively defeat the purpose of equally-spaced characters. The purpose of monospace fonts is to provide definitive clarity where sans and serif fonts fail to do so. In the world of programming, maintaining that consistency is essential. Having one symbol span several spaces undermines that clarity, you may as well be reading your code with Helvetica at that point. I understand that programming is a career path filled with creature comforts and obscure little things that make you happy; I even enjoy the warp cursor (gasp!) in VS Code, which definitely doesn't contribute to clarity. Let's stop treating ligatures like a direct upgrade over normally printed monospace, though. It's an option, one that shouldn't come enabled by default but one that should be available for people who want them for whatever reason.
- blindmute 5y agoMonospace fonts are used mainly because vertical alignment is desirable, and because characters such as ! and . are too narrow to easily read in proportional fonts. Monospace, then, improves clarity. Turning a => into a ⇒ does not affect the vertical alignment nor make anything too narrow to read. It just turns a combination of symbols into its semantic meaning. It allows you to parse a meaningful glyph rather than using a hacky workaround to represent meaning via ascii. This is also the point of emojis: (-_-) is fine, but most people find <expressionless face emoji> to be more clear as to the meaning. Nobody is getting confused about what these ligatures mean. They installed the fonts and selected the fonts in their IDE; they have already been coding; they are not going to see ⇒ where a => used to be and have a brain meltdown.
- lmm 5y agoIf your programming language wants to use an ⇒ symbol there's a perfectly good codepoint for that already. I don't want complexity to be hiding in my font where I would never even think to look for it. (For example imagine searching the documentation to understand a use of ⇒ and finding it doesn't exist in your programming language)
- blindmute 5y agoMy programming language doesn't want to use it; I do. If you would "never even think" to realize that ⇒ in your editor is actually =>, after having installed a programming ligature font where that is always advertised, that's on you. And any developer should already be well aware that no common language uses symbols beyond ASCII, so seeing ⇒ should be clear enough already that it's a ligature. I really think this 'confusion' argument is made up and has never actually occurred for more than 5 seconds. Semantically, the language would like to use a ⇒, because it's representing the idea of an arrow. It's only due to keyboard constraints that it has use use =>. Parsers (and our brain is also a parser) would be much easier to implement if meaning didn't have to derive from symbol combinations like =>, !==, <!--. The input interface is limited to ascii to represent meaning, but our eyes don't need to be.
- thayne 5y ago> no common language uses symbols beyond ASCII, Ruby and scala allow using such characters, and there are libraries that use it. Julia actually has special characters in the standard library, although afaik they all have ascii aliases. The repl and many editor plugins support expanding tex style escapes to those special characters.
- lmm 5y ago> If you would "never even think" to realize that ⇒ in your editor is actually =>, after having installed a programming ligature font where that is always advertised, that's on you. Sounds like we agree that a font that does this should never be a default. I don't think customized environments to the extent that one developer sees a different view of the code from another are a good idea (partly because I think reviewing and pair-programming are very valuable), but I guess if you want to set up something like that it's fine as long as you're not pushing it on anyone else. > And any developer should already be well aware that no common language uses symbols beyond ASCII, so seeing ⇒ should be clear enough already that it's a ligature. I've been using ⇒ in Scala for over a decade, shrug.
- ihateolives 5y ago> It is objectively easier for your brain to parse a single arrow symbol than it is to parse => in a monospace font. For the latter, you are scanning two symbols and only after seeing them both can your brain put them together into a semantic meaning. Brain is really good in parallel processing of letters/symbols as units. I very much doubt that it's "objectively better". See https://docs.microsoft.com/en-us/typography/develop/word-recognition https://docs.microsoft.com/en-us/typography/develop/word-rec... for overview of the research in this area. For me the problem with ligatures is not so much of recognizing them but reproducing. I know that for arrow ligature I have to have = and >, but there may be ligatures that I might not be sure of how they're formed. Also, when reading the same code in different environment where the same font is not available I get different visual output where not only is the base shape of the letters different but code units as well. For example three lined equals ligature that some fonts produce. I really hate it.
- k_sze 5y agoIs ligature rendering context-sensitive? If I put => in a string literal in JavaScript/TypeScript and the IDE "helpfully" decides to apply ligature to it, I'm gonna go insane.