Live data from Hacker News

Ligatures in programming fonts: hell no (2019)

practicaltypography.com

41–50 of 201 posts

Re: Ligatures in programming fonts: hell no (2019)

#42
Just reading all of this (I haven't used ligatures when coding), but the confusion between a ligature of >= and the Unicode ≥ (U+2265) could be handled by the language parser accepting either to mean "greater than or equal to".

Would moving beyond ASCII be that much of a stretch for modern languages?

Re: Ligatures in programming fonts: hell no (2019)

#43
post #42

Just reading all of this (I haven't used ligatures when coding), but the confusion between a ligature of >= and the Unicode ≥ (U+2265) could be handled by the language parser accepting either to mean "greater than or equal to". Would moving beyond ASCII be that much of a stretch for modern languages?

I can’t wait for a programming language that considers the strings ">=" and "≥" to be equal.

Re: Ligatures in programming fonts: hell no (2019)

#44
post #25

> Whereas ligatures are going the opposite direction: making distinct characters appear to be others. Yes. On my computer. In my editor. That I am using…because I like ligatures, because they make my code easier to read. For me. Use of ligatures on my setup does not force anyone else to use them? They’re not “viral” like a language feature. “Oh but what if the >= Unicode symbol ends up in your source code and you don…

> Yes. On my computer. In my editor. That I am using…because I like ligatures, because they make my code easier to read. For me. Later in the submission, Butterick addresses this directly, and doesn't disagree: > “What do you mean, it’s not a mat­ter of taste? I like us­ing lig­a­tures when I code.” Great! In so many ways, I don’t care what you do in pri­vate. Al­though I pre­dict you will even­tu­ally burn your­self…

Later, in the "by the way" section after the article. After an article that in no way suggests it's talking about printed and shared code exclusively. After paragraphs such as this

> 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. If you don’t believe me, try it for 10 or 15 years.

The submission reads very much like an attack on any use of ligatures in code. The comment in the end reads, to me, more like a resignation of responsibility over his claims.

Re: Ligatures in programming fonts: hell no (2019)

#45
post #42

Just reading all of this (I haven't used ligatures when coding), but the confusion between a ligature of >= and the Unicode ≥ (U+2265) could be handled by the language parser accepting either to mean "greater than or equal to". Would moving beyond ASCII be that much of a stretch for modern languages?

Most modern languages already use Unicode for variable names and such. But why would you want to type a Unicode lte/gte character? I’m sure it’s not that hard on a Mac keyboard, but can’t be easier than <=

Re: Ligatures in programming fonts: hell no (2019)

#46
post #37

Ligatures are an interesting contrast to Julia programmers' habit of using actual (non-Latin) Unicode characters in their code. It seemed to me that the use of Greek letters and symbols is actively encouraged in the Julia documentation. I think they advise using editors that allow inputting special characters through their LaTeX equivalent (but source files are then saved to disk with the Unicode characters). I am no…

I'm not familiar with Julia, but I think a useful distinction can be made between input methods and ligatures. An input method is what you have to type to get a particular "code point" or character. Japanese, for example, is often typed using a latin keyboard, and as latin characters are typed, the application substitutes the appropriate Japanese character code point. For example, if I type the characters "n" (U+006E) and "i" (U+0069) using a Japanese input method, a に (U+306B HIRAGANA LETTER NI) (or 二 U+4E8C CJK UNIFIED IDEOGRAPH-4E8C or ニ U+30CB KATAKANA LETTER NI, or others as the case may be) can be selected to be entered. The actual character bytes will be substituted. You typed "n" and "i" but what gets stored is U+306B.

This is in contrast to ligatures: say if there's a fi ligature, I type "If Julia (like APL) uses characters outside the ASCII range as syntax, I suspect that there are input methods to assist in entering them as opposed to ligatures representing them on screen. But that's just naïve supposition on my part.

Another interesting case is TLA+ [1], where the language shares some LaTeX operators which can be rendered for display.

[1]: https://lamport.azurewebsites.net/tla/tla.html

Re: Ligatures in programming fonts: hell no (2019)

#47
post #4

I've witness many a question after/during technical slides where the audience was confused by symbols. At a bare minimum, don't use ligatures in slides or blog posts or anything meant for a broad audience. Ideally, languages would support Unicode as well so you can mean what you say when you type—some folks will naturally prefer this to “keyboard-compatible” options and this should be fine (though ask many non-Anglop…

> slides or blog posts or anything meant for a broad audience.

Or if you're screensharing while pairing, or if a coworker is looking over your shoulder when you're sharing something, or...

Re: Ligatures in programming fonts: hell no (2019)

#48

The ones that just look like regular code with fine tuned spacing are nice. The rest are terrible. Especially if you don't have a math background. If you come from coding, the symbols are meaningless new inventions. To me, >= IS exactly the right symbol. It's the one I learned, the one I actually encounter in daily life, anything else looks like a math paper, not code. Even emoji aren't the best if you didn't type th…

I like them. You just have to get used to them, and before you know it you don't even notice it's a ligature instead of multiple characters

Re: Ligatures in programming fonts: hell no (2019)

#49
post #28

> Whereas ligatures are going the opposite direction: making distinct characters appear to be others. Yes. On my computer. In my editor. That I am using…because I like ligatures, because they make my code easier to read. For me. Use of ligatures on my setup does not force anyone else to use them? They’re not “viral” like a language feature. “Oh but what if the >= Unicode symbol ends up in your source code and you don…

Just was wondering if today anyone is still using them, so I guess that does not need to be asked. All right, oh my captain, keep the indents and spacing tight on the monospace and sail along! Btw., anyone still using monospaced fonts in their editors?

> anyone still using monospaced fonts in their editors?

The question is aren't you?

Post reply on HN