9 votes

Ligatures in programming fonts: hell no

16 comments

  1. [7]
    ThatFanficGuy Link
    Well, I'll go cut my wrists open lengthwise, then. How uptight do you have to be to stick your nose into someone else's business and start pointing fingers at things you find wrong? "This doesn't...

    Bottom line: this isn’t a matter of taste. In programming code, every character in the file has a special semantic role to play. Therefore, any kind of “prettifying” that makes one character look like another—including ligatures—leads to a swamp of despair.

    Well, I'll go cut my wrists open lengthwise, then.

    How uptight do you have to be to stick your nose into someone else's business and start pointing fingers at things you find wrong? "This doesn't work for me, therefore it can't possibly work for you!" Listen, Pedro: I will agree with you the moment I see a ligurature-scented font messing up the visuals of code. Hasn't happened once in, what, five years I've been dabbling with various languages, but I will email you, promise.

    Like a mother coming to her child's house and rearranging stuff in the kitchen. All the same emotional appeals for things one can't reason about, too. "Oh, the heresy of putting cups next to mugs!"

    Now you want to tell me that they way I do the thing I love is wrong? Good luck with that, pal.

    Can't stand it when people confuse their preference for things with their essence.

    15 votes
    1. [2]
      Greg Link Parent
      Fair, with the very strong caveat that it only applies as long as nobody else ever has to read it in that font (e.g. in a print book). If the code sample contains !=, it's abundantly clear which...

      Fair, with the very strong caveat that it only applies as long as nobody else ever has to read it in that font (e.g. in a print book). If the code sample contains !=, it's abundantly clear which two keys I need to press. If it contains something that's rendered as then I'm going to be pasting in a unicode glyph (as I did for this post) and then wondering why it doesn't work.

      10 votes
      1. ThatFanficGuy Link Parent
        If this is something one finds in their published work, someone fucked up.

        If this is something one finds in their published work, someone fucked up.

        8 votes
    2. [4]
      Diff Link Parent
      He actually does address this.

      He actually does address this.

      “What do you mean, it’s not a matter of taste? I like using ligatures when I code.” Great! In so many ways, I don’t care what you do in private. Although I predict you will eventually burn yourself on this hot mess, my main concern is typography that faces other human beings. So if you’re preparing your code for others to read—whether on screen or on paper—skip the ligatures. Not least because you won’t even know when they go wrong. See trademark and copyright symbols for a related cautionary tale.

      9 votes
      1. [3]
        ThatFanficGuy Link Parent
        Which "this" are you referring to? My "this" was that the author shat all over the concept of ligature fonts as if they're the idea of eating off the floor – which is even present in the part you...

        Which "this" are you referring to?

        My "this" was that the author shat all over the concept of ligature fonts as if they're the idea of eating off the floor – which is even present in the part you quote:

        Although I predict you will eventually burn yourself on this hot mess <...>

        3 votes
        1. [2]
          Diff Link Parent
          I meant the idea that he's coming into your kitchen and complaining about the way you do things in your own house. "Oh, the heresy of putting cups next to mugs!"

          I meant the idea that he's coming into your kitchen and complaining about the way you do things in your own house. "Oh, the heresy of putting cups next to mugs!"

          2 votes
          1. ThatFanficGuy Link Parent
            I wouldn't consider it "been addressed". It's more like the passive-aggressive tone your mother takes when you don't call her as often as she'd like. "I don't mind you aren't calling. Sure, you're...

            I wouldn't consider it "been addressed". It's more like the passive-aggressive tone your mother takes when you don't call her as often as she'd like. "I don't mind you aren't calling. Sure, you're busy. You probably won't notice it when I die, but yeah, keep making money"

            4 votes
  2. hamstergeddon Link
    I could understand if ligatures altered the actual characters in the code in such a way that someone downstream from a ligature-user would be negatively impacted. But as it stands it's a local...

    I could understand if ligatures altered the actual characters in the code in such a way that someone downstream from a ligature-user would be negatively impacted. But as it stands it's a local visual change only. The underlying code isn't altered at all.

    They contradict Unicode

    Who cares so long as it's local and visually acceptable to the user?

    They’re guaranteed to be wrong sometimes

    I'm not saying this can't happen, but I've literally never run into any kind of an issue after a few years of using Fira Code. Maybe it's language-dependent? I write primarily PHP and JS and I can't really think of a scenario where I'd be using their example of "=>" for any purpose where the ligature would be inappropriate.

    Bottom line: this isn’t a matter of taste.

    It absolutely is. My use of ligatures has zero impact on people using my code down the road. I'm more than capable of not being confused by ligatures. None of their arguments hold water and they totally come off as a whiny purist. This is the typographical equivalent of the light/dark IDE colorscheme argument, the result of which is "do what you want, it's your computer and your eyes"

    6 votes
  3. [3]
    Bauke Link
    But it will also be right the rest of the time, pick whatever font that works for you and you know the way it behaves. With or without ligatures. It is a matter of taste because as long as you use...

    It’s not aware of the semantic context. Therefore, any global ligature substitution is guaranteed to be semantically wrong part of the time.

    But it will also be right the rest of the time, pick whatever font that works for you and you know the way it behaves. With or without ligatures.

    Bottom line: this isn’t a matter of taste. In programming code, every character in the file has a special semantic role to play. Therefore, any kind of “prettifying” that makes one character look like another—including ligatures—leads to a swamp of despair.

    It is a matter of taste because as long as you use the characters that you're supposed to be using (duh, if you substitute ; (semicolon) for ; (greek question mark) it obviously will never work, that's not dependent on a font with ligatures) it will not make a difference whether I use Hasklig (monospace with ligatures) or Papyrus as my font... Because you will never see it, you will just see the code in whatever font you decide to use.

    5 votes
    1. [2]
      ainar-g Link Parent
      Unless you typeset a book with your favourite ligature-rich font. Or use it on a website with a @font-face. And then I have to read it.

      Because you will never see it, you will just see the code in whatever font you decide to use.

      Unless you typeset a book with your favourite ligature-rich font. Or use it on a website with a @font-face. And then I have to read it.

      6 votes
      1. cwagner Link Parent
        I agree with that. I don't want those to be public. But for my IDE, I like them.

        I agree with that. I don't want those to be public. But for my IDE, I like them.

        2 votes
  4. acdw Link
    What I find really funny about this article is the immediately previous post, about two spaces after periods: I personally use Fira Code, and I like it, though I do wish I could remove some...

    What I find really funny about this article is the immediately previous post, about two spaces after periods:

    Typography is not a science. [...] But in the end, it’s up to you. I’ve never held myself out as the apex tastemaker nor the typography police.

    I personally use Fira Code, and I like it, though I do wish I could remove some ligatures (I don't like "www", for example). I guess I could fork the font, but that seems like a lot of work.

    5 votes
  5. ainar-g Link
    An interesting opinion piece I'd like to share. Found on HN, the discussion there has interesting points too.

    An interesting opinion piece I'd like to share. Found on HN, the discussion there has interesting points too.

    2 votes
  6. [2]
    feigneddork Link
    Real developers code with the Comic Sans font 😎

    Real developers code with the Comic Sans font 😎

    2 votes
    1. ThatFanficGuy Link Parent
      Is it you who comes up when designers say "Beetlejuice" three times?

      Is it you who comes up when designers say "Beetlejuice" three times?

      1 vote
  7. jgb Link
    Last time I checked, computers allow you to pick what font you want. I really don't see why this is a topic that requires an admittedly nicely typeset polemic.

    Last time I checked, computers allow you to pick what font you want. I really don't see why this is a topic that requires an admittedly nicely typeset polemic.

    1 vote