Stories
Slash Boxes
Comments

SoylentNews is people

posted by Fnord666 on Monday July 24 2017, @03:39AM   Printer-friendly
from the not-no-but-... dept.

Submitted via IRC for Bytram

Ligatures in programming fonts — a misguided trend I was hoping would collapse under its own illogic. But several readers have already sent me this new argument in favor.

Let me save you some time:

Ligatures in programming fonts are a terrible idea.

And not because I’m a purist or a grump. (Some days, but not today.) Programming code has special semantic considerations. Ligatures in programming fonts are likely to either misrepresent the meaning of the code, or cause miscues among readers. So in the end, even if they’re cute, the risk of error isn’t worth it.

There are good reasons we have Unicode and this is NOT one of them.

Source: http://tinyletter.com/mbutterick/letters/q-ligatures-in-programming-fonts-a-hell-no


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 2) by Arik on Monday July 24 2017, @03:56AM (13 children)

    by Arik (4543) on Monday July 24 2017, @03:56AM (#543571) Journal
    Had to hit the link to figure out what you were talking about lol.

    Ligatures are fine with me, but he's talking about something rather different from that, apparently the fonts(!) can now be programmed to blur the distinctions between non-ligatured letters.

    Lovely. Go integrate that into systemd, the effect will be synergetically enhanced for Maximum Fedora.
    --
    If laughter is the best medicine, who are the best doctors?
    Starting Score:    1  point
    Karma-Bonus Modifier   +1  

    Total Score:   2  
  • (Score: 2, Funny) by Anonymous Coward on Monday July 24 2017, @04:23AM (8 children)

    by Anonymous Coward on Monday July 24 2017, @04:23AM (#543574)

    Posting AC because this will vaporize my karma.

    I would like to program in a serif font, with ligatures. Elastic tabstops [nickgravgaard.com] would keep everything aligned.

    The only reason I don't do this is because as far as I can tell, there are no elastic tabstops for Vim or Netbeans.

    • (Score: 0) by Anonymous Coward on Monday July 24 2017, @04:40AM (1 child)

      by Anonymous Coward on Monday July 24 2017, @04:40AM (#543577)

      You should really use that with proportional fonts and python language.

      • (Score: 2) by Pino P on Monday July 24 2017, @02:19PM

        by Pino P (4721) on Monday July 24 2017, @02:19PM (#543690) Journal

        One simple rule lets an editor draw 4-space indentation (as is traditional for Python and Java) sanely in a proportional font: Draw line-initial space characters the same width as the characters immediately above them. This way, a 4-space indentation below for or def or while is as wide as "for " or "def " or "whil" in that font. As an exercise, try this rule with the examples in PEP 8 [python.org] and let me know what breaks. I anticipate that this rule will mishandle very little apart from multiline strings introduced with triple quotation marks.

    • (Score: 2) by bzipitidoo on Monday July 24 2017, @06:29AM (4 children)

      by bzipitidoo (4388) on Monday July 24 2017, @06:29AM (#543584) Journal

      Okay, I'll take your post seriously. Interesting, but I don't see any advantage of elastic tabstops over HTML table cells.

      It's a very bad idea to redefine an ASCII control character that is still commonly used. Leave CR, LF, and Tab alone. And for good measure don't mess with Null, Esc, or backspace either.

      • (Score: 2, Informative) by anubi on Monday July 24 2017, @10:30AM

        by anubi (2828) on Monday July 24 2017, @10:30AM (#543627) Journal

        Good Lord!!!

        As if we weren't already having enough problems with alphabetic capital "O" looking a helluva lot like a numeric "0", and lower case alphabetic "l" looking like a numeric "1", we haven't had enough of this look-alike confusion?

        The only thing this looks good to me for is to enable one to more easily write obfuscated code that looks like it does one thing and actually does another.

        --
        "Prove all things; hold fast that which is good." [KJV: I Thessalonians 5:21]
      • (Score: 0) by Anonymous Coward on Monday July 24 2017, @02:30PM (2 children)

        by Anonymous Coward on Monday July 24 2017, @02:30PM (#543694)

        As if tab character had ever had a single agreed-upon definition.

        • (Score: 1) by Arik on Monday July 24 2017, @07:14PM

          by Arik (4543) on Monday July 24 2017, @07:14PM (#543844) Journal
          "As if tab character had ever had a single agreed-upon definition."

          TAB - Advance to the next tab stop.

          TABs had a single agreed-upon definition from the start, it was the implementation of the tab stop that, in retrospect, might have been more tightly specified.
          --
          If laughter is the best medicine, who are the best doctors?
        • (Score: 0) by Anonymous Coward on Monday July 24 2017, @07:16PM

          by Anonymous Coward on Monday July 24 2017, @07:16PM (#543846)

          A tab character is like a dick, the size may vary but it's still a dick.

    • (Score: 0) by Anonymous Coward on Tuesday July 25 2017, @03:50AM

      by Anonymous Coward on Tuesday July 25 2017, @03:50AM (#543993)

      Why don't you use an editor with multiple cursors, like vis, kakoune, or sublime in a terminal that supports ligatures? You can easily align everything with multiple cursors, and it doesn't seem like it would be too hard to to write a plugin for elastic tabstops.

  • (Score: 3, Insightful) by driverless on Monday July 24 2017, @10:36AM (3 children)

    by driverless (4770) on Monday July 24 2017, @10:36AM (#543629)

    I don't understand what he's complaining about. How can you get ligatures in a programming font? All the letters are a fixed distance apart.

    • (Score: 3, Informative) by Pino P on Monday July 24 2017, @02:37PM

      by Pino P (4721) on Monday July 24 2017, @02:37PM (#543699) Journal

      How can you get ligatures in a programming font?

      The ligature for ->, for example, would appear as a 2-cell-wide variant of → (U+2192 RIGHTWARDS ARROW).

      All the letters are a fixed distance apart.

      Glyphs for Japanese kana (other than half-width katakana) and kanji are 2 cells wide in a monospace font. These ligatures would presumably be as wide as Japanese characters. A program can guess a character's monospace width based on the Unicode character database's EastAsianWidth.txt file: F and W categories canonically get 2 cells, others 1.

    • (Score: 1, Funny) by Anonymous Coward on Monday July 24 2017, @06:17PM (1 child)

      by Anonymous Coward on Monday July 24 2017, @06:17PM (#543804)

      Elastic tab AC here. (Had a laugh my comment is at +2 funny, but I'd like to confirm I was being serious.) While ligatures really only make sense in a proportional font, I have a supposedly fixed-width font, cannot remember which one it is, Fantasque Sans Mono or Liberation Mono maybe?, that combines for example two adjacent "f"s into a single character (and exactly one character, keeping with the monospace indication, if ligatures are compatible with monospace at all, which I see is debatable). So they do exist.

      I don't use that font because it bugs the shit out of me to have an "f" occupying essentially half a character width in a font that is supposed to be monospace. The combined ligature character is certainly monospace and does not break kerning, but I think I agree that it's just not right! Proportional, serif typeface with ligature support and elastic tabstops, the whole nine yards, otherwise I will continue to be satisfied to use a monospace font like everybody else.

      • (Score: 1) by Arik on Monday July 24 2017, @07:12PM

        by Arik (4543) on Monday July 24 2017, @07:12PM (#543843) Journal
        "(Had a laugh my comment is at +2 funny, but I'd like to confirm I was being serious.)"

        One day a real rain will come and wash all the scum off the streets.

        "I have a supposedly fixed-width font, cannot remember which one it is, Fantasque Sans Mono or Liberation Mono maybe?, that combines for example two adjacent "f"s into a single character (and exactly one character, keeping with the monospace indication, if ligatures are compatible with monospace at all, which I see is debatable)."

        What a strange notion, that someone put in the work to make something like that happen on purpose.

        "The combined ligature character is certainly monospace and does not break kerning, but I think I agree that it's just not right!"

        Agreed, it's a font creating a ligature on its own and that is just not right.

        Just don't confuse this with normal ligatures. Æ should be a ligature because I typed it that way, but if you had a font (a font!) going through and effectively doing a s/ae/æ routine without being asked, that would be messed up. The closest thing to a double 'f' I can think of that gets typed on purpose is ß - that's actually a double 's' but depending on your font it could like very 'f'ish.
        --
        If laughter is the best medicine, who are the best doctors?