Live data from Hacker News

Ligatures in programming fonts: hell no (2019)

practicaltypography.com

21–30 of 201 posts

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

#22
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…

> At a bare minimum, don't use ligatures in slides or blog posts or anything meant for a broad audience

This seems a much more reasonable take

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

#23
post #9

I gotta say I’m a little tired of using * for multiplication. It’s time for programming languages that use Unicode characters for operators, and let the editor replace != with the Unicode slashed equals character. No ligatures, just operators.

There are really two separate issues here - ligatures in the classic typographic sense, such as æ, and having some way to type mathematical symbols useful in programming, such as ≠ and ⨯, without having cntl-alt-meta-super keyboard combos to remember.

The former doesn't help in programming. The latter is fairly standard for ideographic languages, and has been well worked out for Chinese and Japanese.

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

#24
> For instance, the example below is from Kent Dybvig, The Scheme Programming Language, 4th ed. In this chunk of Scheme code, the opening-quote marks are supposed to be backticks; the closing-quote mark is supposed to be a single straight quote:

Sorry, as a Lisp person, I don't see the problem. In Dybvig's typography, it's evident that an opening quote which looks like a 6 is the quasi-quoting backquote, and the closing quote is the regular quote.

It is legitimate for the apostrophe to appear as either a vertical tick or a 9 shape:

https://en.wikipedia.org/wiki/Apostrophe

Particularly this section:

https://en.wikipedia.org/wiki/Apostrophe#Typographic_form

Evidently, the 9 shape is the "typographic form" whereas the straight tick is "typewriter". The last paragraph of that section claims that this was a simplification for typewriters so that the glyph could fulfill multiple roles at the same time (including, possibly, simulating an exclamation mark, if overlaid over a period!)

In the USASCII system, there is only one character code for this, so in a given font, you get only one or the other. In a font where the ' character looks like a 9, you want ` to look like a 6. Or else if ' looks like a vertical stroke, then ` looks like a backward-slanted stroke of a size which harmonizes with that one.

It looks like the printed version of Dyvbig's book has a font which is typewriter-like, but uses the typographic form for these glyphs (thus undoing the hack that was perpetrated for the sake of typewriters). It's quite readable; there is no mistaking the forward tick for the backtick.

I now want a programming font which has those.

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

#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 on this hot mess, my main con­cern is ty­pog­ra­phy that faces other hu­man be­ings. So if you’re prepar­ing your code for oth­ers to read—whether on screen or on pa­per—skip the lig­a­tures.

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

#27
post #3

Earlier quoted context omitted.

It's probably fine for you reading your code. It's not impossible it causes others reading your code some confusion when they render it with ligatures or receive eg pdf of it in ligatures, distinct from how it looks when they edit it. Minor issue mostly. I tend to "no", but for no very good reason: Aesthetically they're lovely.

Other people reading your code... on your laptop, using your editor? Because on anyone else's computer it's going to be based on their personal viewing preferences. Setting your tab spacing size too large will also make your code unreadable. But only on your computer.

> Other people reading your code... on your laptop, using your editor?

No, rather in your web page, in the slides that you're projecting, in the paper that you typeset into PDF...

The point is not about how you edit your own code. You could even write comments in sanskrit, if they are for your eyes only, but please don't dostribute them!

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

#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?

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

#29
I think it's deeply personal and some fonts just do it better than others.

I tried for a while and it had pros and cons. Unfortunately it made me be confused one time too many so I reverted to not using ligatures.

Point is, find what works for you, we don't have to debate about this, and thankfully, we don't commit that stuff so that it becomes flame wars like tabs and spaces.

Post reply on HN