Live data from Hacker News

Ligatures in programming fonts: hell no (2019)

practicaltypography.com

121–130 of 201 posts

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

#121
post #32
post #25

Earlier quoted context omitted.

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

That's a good advice, isn't it? Thanks for pointing to it. But it is interesting still, how many seem to read the text it feels to them touching their privates and need to make themselves vent off.

Is it really that surprising that a post written in a confrontational, argumentative style produces similar responses?

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

#122
post #89

Earlier quoted context omitted.

You don't even have to go as far as a triangle. There are two sets of the latin alphabet in unicode and two sets of the greek. The normal one and the maths one. And the mu on your keyboard is not the same on a windows machine and a linux machine. (Alt Gr + m, at least in my language)

For portable code, use UTF-8 only, and only the part in ASCII. This also helps to distinguish digits from alphas etc. Unicode is a different code. (and as I learned today, Julia code might be exclusive here)

UTF-8's using only characters from the ASCII subset is just ASCII, this was kind of the point of UTF-8 at inception.

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

#123
Refute of point one: these are substituted for display only. It does not matter if they clash with an actual Unicode code point

Why? This brings us to refute of point two: lack of semantic substitution is a hypothetical problem (it could easily be solved though by parsing the source before substituting).

But here is the refute: how often do I come across this?

And how, exactly, could I shoot myself in the foot with it?

The author omits answering that question.

I studied typography alongside CS and worked in the former field for years so I have strong opinions on use of type for stuff other people look at.

My editor is, however, something only I look at.

I use code-type fonts with ligatures since years in various editors (vscode the last four), writing mainly Rust. I never ran into either issue one or two.

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

#126
post #39

> if you’re preparing your code for others to read—whether on screen or on paper—skip the ligatures. The article should have led with this. Instead this main caveat is buried in a paragraph, where it is preceded by, what boils down to, "do what you want, but you will recognize its wrong someday." Of course people will focus on that part and on the most prevalent use of ligatures in programming: In their own local edi…

Δ vs ∆ is a slightly better example, since traditional printed mathematics just used the former.

(Not making you look: U+0394 GREEK CAPITAL LETTER DELTA vs U+2206 INCREMENT)

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

#127
Ligatures in code is choosing form over function.

It’s like a rectangular sink with sharp edges that’s hard to clean. It’s like writing javascript without semicolons: yes, it’s prettier, but you gotta keep yet another set of rules and exceptions in mind to get it right.

For example, a JS regex like /=foo/ combines the /= into a ligature in Fira Code with default settings. That’s just confusing right? The / is a delimiter and the = is part of the regex itself. It means you need to keep like 0.5% of brainspace available for “reverse parsing” the ligatures on your head. Why waste that? Why spend even a tiny fraction of your mind worrying if you saw that thing right?

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

#128

Earlier quoted context omitted.

A Compose key is the best general-purpose way. For example: • ≥: Compose > = • ≠: Compose / = You can define your own sequences too, if you want. I like to type exactly what I mean, including curly quotes and dashes and narrow no-break spaces and emoji and so on, but often didn’t like the default mappings (if there were any). As an example, I use this for curly quotes (look at the keys’ locations on the keyboard to u…

Fun but I tend to type code fast . Really dont need an extra modifier key. Not to mention there isnt one on your regular keyboard.

Microsoft's clumsy extension of IBM's short-sighted PC keyboard (and CUA) has a lot to answer for. It's too bad they didn't do a better job of ripping off either Apple keyboards or Unix workstation keyboards.

I personally use AltGr (Mac Option) more than compose, since it's tractable to have almost the same layout on *nix and Mac. IIRC the default Mac layout has ≠ and ≤ ≥ in the obvious places, and they are just as easily touch-typed as shifted characters.

Compose is nice (on xkb systems) in that it's very easy to add personal customization to ~/.XCompose for task-specific characters.

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

#129

Ligatures in code is choosing form over function. It’s like a rectangular sink with sharp edges that’s hard to clean. It’s like writing javascript without semicolons: yes, it’s prettier, but you gotta keep yet another set of rules and exceptions in mind to get it right. For example, a JS regex like /=foo/ combines the /= into a ligature in Fira Code with default settings. That’s just confusing right? The / is a delim…

For any language that uses / as a delimiter, well, you probably don’t want to use a font that does something special to /=. Rendering should also avoid using ligatures in quotes (strings, where reflex might be used in Java or Kotlin). I see ligatures as potentially good, but not unless they are integrated into the language’s lever rather than provided directly by a font.

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

#130
post #98

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

Ligatures in a fixed width programming context still take up the full width of the separate characters, so a unicode symbol of the ligature has a different width from the ligature itself, and this is immediately obvious.

[deleted]
Post reply on HN