Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I strongly dislike the trend towards ligatures by default in newer fonts. Maybe it’s because I learned without them, but I find that the readability of code is far worse with ligatures.

My personal favorite fonts at the moment are Jetbrains Mono & MonoLisa (both with ligatures disabled of course)



I don't use ligatures only because the font is the wrong level of the stack for doing cute things like this. I could totally get behind e.g. combining `->` into a Unicode arrow, but if I'm writing the string `"->"` then I want that to be displayed verbatim. That requires parsing (or at least lexing) the code, which fonts can't do (and if they could, I'd be horrified). IMO, it should be the responsibility of editors and IDEs to do this sort of visual substitution.


Unicode operators can make it difficult if you can't (or don't know how) to type certain characters.

https://docs.raku.org/language/unicode_ascii just kind of rubs me as the wrong way to go.

While I realize '…' and '...' are syntactically equivalent, it means that if someone is writing $foo³ and I need to change that to $foo² - I can't do that without changing it to $foo**2 ... and that results in two different styles of code (unicode and ascii) in the same file which means that future maintainer me has more difficulty.

(note: I still don't know how to type ³ - that's me copying out of another file)


That feels to me that you're blaming a poorly implemented editor / IDE for a language feature.

If you use ² and ³ a lot in your work, I'm sure you can install a macro / keybinding / whatever to access them quickly.

And in any other case, https://docs.raku.org/language/unicode_ascii is a bit of a Rosetta stone in the cases you don't know how to type them, because you can copy / paste them from there.

Finally, the Raku documentation also contains information on how to type these unicode characters on your OS: https://docs.raku.org/language/unicode_entry .


I believe that the language feature is cute.

I'm ok with APL doing all its special characters, but if you can write the same syntax in two ways, one of which is much more accessible than the other, then the less accessible way was a poor design choice.

Allowing for two styles for the same syntax can (and will) lead to multiple styles depending on who wrote that line. Conflicting styles (mixing tabs and spaces anyone?) in turn makes the maintenance of the code more difficult and time consuming which is something that is often forgotten in the rush to write code.


Agda users rely heavily on unicode. It looks like they have editor support for it in the form of backslash sequences that turn into unicode.

They write stuff like:

    Tyᴹ : (A : Ty) → {X₀ X₁ : Set} → (X₀ → X₁) → Tyᴬ A X₀ → Tyᴬ A X₁ → Set
    Tyᴹ ι      Xᴹ α₀ α₁ = Xᴹ α₀ ≡ α₁
    Tyᴹ (ι⇒ A) Xᴹ α₀ α₁ = ∀ x → Tyᴹ A Xᴹ (α₀ x ) (α₁ (Xᴹ x))
I kind of get the "looks like math" thing, but I find the poor typography distracting.

(Sample taken from https://github.com/AndrasKovacs/thesis/blob/main/agda/Simple... - learning the language is still on my todo list.)


I like using more than ASCII. But those superscript numerals are just legacy junk. Superscripts are only in Unicode for the sake of compatibility.


How would you express superscripts in text, then?


You don’t express it in plain text. They claim that it’s the domain of markup.


sup


Not much, ʷᶦᵗʰ ʸᵒᵘ?


Combining `->` into unicode arrow still would require parsing the code to do properly. For example, in firacode this C code:

      int x = 3;
      if (x<-5) {
        return 1;
      }
Renders as:

      int x = 3;
      if (x⬅5) {
        return 1;
      }
which makes no sense.


Totally agree. The worse is those long equal signs, with my eyesight going as I age I have to take close to a second to decipher if it's =, ==, or ===.


You're not alone. Some typographers agree: https://practicaltypography.com/ligatures-in-programming-fon...

With a userstyle you can turn off ligatures in your browser for code blocks. The trend isn't just editors, but some developers want to push it on their audience in their blog too. https://developer.mozilla.org/en-US/docs/Web/CSS/font-varian...


The first link doesn't work, looks like you need to replace '.HTML' with '.html' to get the right thing.


Fixed


I'm the opposite - I love the ligatures precisely because of their readability.

For context, I'm 40, and spent decades programming without them.


I'm 45 and I was excited to use them at first, but then as I was changing editors/terminal emulators, coding fonts, I couldn't always had them anyway, so I'm not attached to the idea.

I also prefer the lack of them, exactly because they apply to strings and comments too, where they are often undesired.

I write Clojure code most of the time, so maybe that's a deciding factor too...


Same. 47, only started using ligatures this year (in MonoLisa) and love em.


Approaching mid 30s here, been writing code in some form or another for a couple decades and I enjoy ligatures too.


IMO ligatures makes it easier to recognize common symbols used in programming languages and also doesn't affect readability much. Maybe I am younger, but I don't see the problem here.


I don't like it because it tends to combine two distinct characters into one (visually). A great example is '<=' being transformed into '≤' (Pragmata Pro[1] does this) I expect to see two characters, but instead I see one and expect to see a syntax error.

[1] https://fsd.it/shop/fonts/pragmatapro/


Also it's incredibly annoying when a language uses `<=` for something that's not a comparison.

Julia was right in allowing developers use unicode for variables and operators, so if you want ≤ you simply use that directly (or type \leq in your editor).


Note that PragmataPro offers both ligature and non-ligature styles.


You expect that exactly because (like me) you've been seeing it for a long time. I suspect the age correlation parent suggested is a big factor


I don't know about this claimed correlation- I'm 50 and love ligatures


It's almost like there are different people who like different things and it's impossible to turn a subjective thing into an objective thing.


Nah, I heard someone on the internet saying it was an age thing.


It's not about age. I'm rather oldschool, and I like programming ligatures very much. When => intended to imitate thick arrow, seeing thick arrow instead is reasonable, I think


True, but <> in Perl is called the diamond while, in other languages it means “not equal”. If we take ligatures seriously, we’d need them to be language-aware to select the appropriate concept. And for a font to have to be aware of all languages that can express ideas with it is a violent violation of the separation of concerns principle.

If languages opt to make “≠” equivalent to “!=“, match all styles of open/close quotes, and enable me to attribute a value to a variable using an arrow, that’s great.

In the meantime, I’m not sure they are a net positive in all cases and fear they may drive unfortunate syntax choices for people who design languages.


PureScript and Haskell <> is concat in most Preludes. However, both languages allow you create your own infix operators and you can use Unicode.


>If we take ligatures seriously, we’d need them to be language-aware to select the appropriate concept.

It's possible in Emacs: to enable relevant ligatures for an active mode.


Especially egregious in technical blog posts when the author uses them because they think it looks nice but then forgets that not everyone knows what those symbols mean. Leave ligatures out of code blocks.


Same here. I was raised on Apple screens, 80x25 EGA and VT100 terminals in the 70's & 80's, so I find ligatures to be wildly annoying and error prone, as well as nonportable: having to mentally switch back and forth on different terminals or code UIs is jarring.


My terminal emulator of choice (kitty) lets you configure it to render ligatures only when the text is not under the cursor.

I’ve found this to be the best of both worlds. I like reading code with ligatures but would always get tripped up when editing.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: