News for hackers. Stuff that matters.
Re:MonoLisa – A font designed for developers by blindmute on Monday February 14, 2022 @08:48PM (#30341534)
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.
Re:MonoLisa – A font designed for developers by ihateolives on Tuesday February 15, 2022 @04:12AM (#30344280)
> 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-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.

Re:MonoLisa – A font designed for developers by lmm on Monday February 14, 2022 @09:08PM (#30341716)
If 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)
Re:MonoLisa – A font designed for developers by blindmute on Monday February 14, 2022 @09:36PM (#30341962)
My 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.

Re:MonoLisa – A font designed for developers by lmm on Monday February 14, 2022 @09:44PM (#30342011)
> 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.

Re:MonoLisa – A font designed for developers by blindmute on Monday February 14, 2022 @10:42PM (#30342485)
I agree it should not be a default. I think much like using the keyboard to navigate the IDE, it's something you can do that brings a benefit once you're familiar with the basics. I don't think vim should be the default terminal editor for the same reason, but I still think vim is worthwhile to use.
Re:MonoLisa – A font designed for developers by thayne on Monday February 14, 2022 @10:51PM (#30342571)
> 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.

Re:MonoLisa – A font designed for developers by FridgeSeal on Tuesday February 15, 2022 @12:41AM (#30343221)
I use Fira code, and the ligatures for >=, <=, !=, ==, and -> make it so much faster and easier to identify the symbols.

I wouldn’t know where to get the “⇒” codepoint, and getting is probably more effort than just writing “==>” with the added benefit of my teammates not having to use the ligature (or figure out the symbol) if they don’t want to either.

Re:MonoLisa – A font designed for developers by smoldesu on Monday February 14, 2022 @09:05PM (#30341689)
If 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.
Re:MonoLisa – A font designed for developers by blindmute on Monday February 14, 2022 @09:51PM (#30342075)
Monospace 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.
Re:MonoLisa – A font designed for developers by k_sze on Tuesday February 15, 2022 @06:11AM (#30345058)
Is 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.