Comment by cosmotic

2 years ago

Ligatures make code harder to read and harder to edit. It's not just personal preference, it's the science of usability. When I press backspace or cursor keys, I expect one glyph to be erased, not who-knows-how-many (half?!).

Authors of content and programs with ligatures-by-default subject their readers and users to the penalty of ligatures.

Some people like pain, but that doesn't mean we need pain switches on everything with pain set to on by default.

> When I press backspace or cursor keys, I expect one glyph to be erased, not who-knows-how-many.

That's you, and not very generalizable. Many people edit on sites with ligatures and many people edit non-Latin text where isolated, non-ligatured text is wrong (Arabic, some Indic scripts, Han characters, Japanese katakana).

Me personally, with respect to code, I pretty much think in terms of tokens: to remove the `==`, I backspace twice, rather than that to remove the `==`, I remove `=` and then the other `=`, and each requires one backspace.

  • Also ligatures in a monospaced font are going to tell you they’re multiple characters because they’re either fat af or misaligned. You know it’s coming.

    To be honest though I think I like those big fat commas the best. As someone pointed out, using dot and comma as semantically important in software is a mistake because they only differ by one pixel.

    • Vertical columns of background have, until ligatures, been a bullet proof means for brains to delineate characters. Is it possible to figure out with an increased cognitive load? Yes. Is it exactly as easy as without? No.

      2 replies →

If it's established science that they are worse, could you share some citations backing that?

> It's not just personal preference, it's the science of usability

It's obviously personal preference, because many people prefer it. If I found ligatures harder to read or edit then I wouldn't use them, but I don't, so I do.

> programs with ligatures-by-default

Such as?

  • >If I found ligatures harder to read or edit then I wouldn't use them, but I don't, so I do

    people likely prefer them for aesthetic reasons, just like they do certain color schemes, but there are objective answers in regards to legibility, and many people certainly use suboptimal setups. Lots of people code sitting hunched in front of their computer too, which is their personal preference, but also objectively bad for your neck.

    Ligatures suffer from some straightforward objective issues, like being semantically wrong in certain cases. An inequality check should be a ligature, but in a literal string the character sequence is likely not intended to be subsituted. As such they create unecessary ambiguity, which is just bad.

    Also they functionally don't have a reason to exist in monospaced fonts which are the norm in coding. given that The issue they're intended to address is overlapping characters.

  • Preferring it is personal preference. It being good or better is science. People prefer dark theme even though it's objectively harder to read because of the reduced contrast ratio, among other reasons.

    • Highly convenient that your preference is “science” whereas other people’s preference is just a preference. I’m not a ligatures fan myself but it seems completely arbitrary and don’t see at all how it’s scientific. You could convince me otherwise by posting some references to this science.

      1 reply →

    • Are you haranguing people about liking dark mode in comments sections as well, or just ligatures?

      > It being good or better is science

      Citation needed.

    • You've shot yourself in the foot with your dark mode comment. It's not scientifically proven that dark mode is better than light mode or vice versa. It has been proven, as you mentioned, that contrast ratio is important. Contrast ratio is not dependent on if the background is dark or light. It's dependent on the comparison between the dark and light shades.

Ligatures make code easier to read because they map 1-to-1 to tokens. Ideally, the font would also be proportional; and the IDE would support elastic tabstops... But the tech isn't there yet.