Hacker News new | past | comments | ask | show | jobs | submit login

Please stop it with the "coding ligatures" already. They are not helpful and only serve to obscure the code being written.

This has got to be one of my least favourite trends in programming aesthetics these days. For a font claiming to "follow function" to devote so much effort to sacrificing function for the _vogue du jour_ is especially rich.




Please stop it with the diatribes about ligatures.

If you don't like them, don't use them. It's that simple.

Other people do like them, and will continue to use and enjoy them.


Serious (if goofy:) ) question: How do I not use them?

My understanding is that if the font has ligatures then the way to not use them is to use a different font (which is fine - there's a lot of fonts out there :) ).

Is that the only way, or is there a way to disable ligatures but keep the rest of the font? Can you disable only some of the ligatures?

TIA!


Literally every IDE that I used has checkbox to disable ligatures. Idea, VS, VSCode. Kitty terminal also has setting to turn them on/off.


Ligature is a optional feature, first the editor need to support them, but I guess most editors nowadays already support that. JetBrains IDEs come with JetBrains mono and with ligatures enabled, last time I used VScode I had to enable manually for my new font.


Some fonts also just have different variants with and without ligatures, for example Cascadia Code/Mono: https://github.com/microsoft/cascadia-code


In JetBrain products: Preferences -> Editor -> Font -> Enable ligatures

So you can turn them off even in fonts that have them, but most fonts have separate versions with and without anyway.


For VS Code see (1) and to selectively disable them (2).

For Atom see (3).

There does not appear to be a way to disable them in Visual Studio.

(1) https://stacksjar.com/post/use-of-font-ligatures-in-vs-code

(2) https://marketplace.visualstudio.com/items?itemName=Coenraad...

(3) https://github.com/tonsky/FiraCode/issues/633


Ooh the selectively disabled extension is really cool! Thanks!

I sometimes—rarely happens thought—dislike how the cursor renders on top of ligatures in vscode. Always wished it would allow me to "inject" the cursor into the ligature, but since it didn't happen often or bother me as much, I never tried looking for a solution. This will be a small, but much appreciated quality of life improvement! Thanks again!


> Is that the only way, or is there a way to disable ligatures but keep the rest of the font?

It's actually not that easy to use them with for example Emacs where you have to list every combination that you want to 'translate' to a ligature:

https://github.com/mickeynp/ligature.el


how to not use them is editor dependent.

but you absolutely don't have to use them.

regular fonts are basically "use this image for 'a', this image for 'e'" etc. ligatures are extra data that says "if you find an 'a' next to an 'e', use this other image in place of the 'a' and 'e' images". but the non-ligature versions of characters are still in the font for use when there is no ligature sequence (just put a space in the middle of any ligature in your editor and you'll still see the independent characters rendered in the font).


I like some like ff, but </ is too far.


<opinion>They are not helpful and only serve to obscure...</opinion>

Personally -- after originally thinking like you -- I really enjoy ligatures in my code. I disable them for my terminal though.

The same font can work both with and without ligatures, so it's not a negative if a font supports them. You can choose whether to enable them.


I mean... The existence of ligatures is almost by definition strictly aesthetic. And on that measure, it either brings you a smile to notice that f and i, for example, are joined; or you didn't even notice it.

That is, I won't claim they help readability. But they do make me smile, and don't seem to hurt. (I'm assuming they disappear on copy operations. Mac OS' habit of replacing -- with a longer dash is painful when sending cli arguments.)


There's a third option: "What is that?"

When I'm reading fiction, I generally don't mind ligatures. I find them oppressively obscurantist in any situation where I want to know clearly and distinctly what each character is -- i.e. code and science/math/engineering.


I'd wager that the vast majority of the time, you just don't notice them.

About the only time they are easily visible is in large type, when they really shouldn't be used.

It's kind of like right justified text. Done well, it shouldn't be noticed how it was done.


Please don't tell me what I do and don't see when I just told you what I see and how I feel about it.


Not sure why you are taking offense in that. I wrote that they make me smile. Despite that, I'd also wager that the vast majority of the time, I don't notice them.


Optional part of free thing upsets HN, more at 11


This is actually 100$+.


For this font, but there are several other dev fonts with ligatures.


Just for the record: completely disagree with you, and will never again in my career use a coding font that doesn't support ligatures.

So, YMMV.


Lucky for you, you can disable ligatures or not use a font that you don't like.


How about whoever wants them to enable them?


You are taking this backwards.

- there are more fonts without ligatures than there are fonts with ligatures. - every single OS I can think of include by default a monospace font that do not support ligatures. - there are still a huge amount of terminals which do not support them. - for almost any font that has ligature there is a variant without ligature - there is virtually no way to end up with ligatures without actively looking to get ligatures. - any terminal/editor that supports ligature has a setting for that. - most people do actually like ligatures which is the reason they use those editors/terminal/fonts and want those activated by default.


That's up to your editor, the font doesn't get to choose what the default is.


You are missing the point.

Presence of ligatures in a "font designed for developers" is neither a plus nor a selling point. It is a pointless embellishment that shows that fonts' authors don't grok the character-oriented nature of computer languages. So them parading ligatures as something desirable only serves to detract from the rest of the font design and to nick their credibility as coding font designers.


> It is a pointless embellishment

That's like your opinion man.

> So them parading ligatures as something desirable

Others desire them, so they include them. I thank that.

> shows that fonts' authors don't grok the character-oriented nature of computer languages

Nonsense, just an empty insult. I don't think you grok ligatures.

> only serves to detract from the rest of the font design

Your opinion, I believe it enhances the font design.

> to nick their credibility as coding font designers

Another empty insult. Including a feature that people like doesn't hurt their credibility.

See also:

https://www.dictionary.com/browse/subjective

https://www.dictionary.com/browse/opinion

https://www.dictionary.com/browse/aesthetic


> fonts' authors don't grok the character-oriented nature of computer languages.

Hogwash. They provided all the characters (which ligatures are also, but you seem bizarrely "against" but "for" the ASCII ones), and ligature-less versions as well. So they grok it at least that far.


For what it's worth I also have ligatures disabled but I do think it's fair for fonts to include them, particularly because it makes the fonts more versatile in settings where you want them.

In particular when doing presentations having fonts that are capable of producing ligatures in monospace contexts is quite useful.


I would concede your point if these folks were trying to sell you a used car.

You don't need to take their word or rely on their credibility for anything. There's a demo right there of the font for you to decide if it's for you or not.


I wonder if there’s a correlation between enthusiasm for ligatures and programming styles or languages.

I want to learn Julia in part because it makes use of “fancy” chatacters (so your math looks like math). I like the more functional JS style, and I’m interested in haskell. And I love ligatures. Anedata of one.

Are you more a C-family person, or an ML-family person?


Why?

I love them ligatures. I'm looking at this code for lots of hours every day. Let me enjoy it via a nice font — with ligatures — if I deem so.


You can simply disable them.


I kind of agree with you, but I see them authors as avant-garde. Let them be and perhaps something new or an improvement will come out of it for the rest of us.


I mean ultimately, all characters are "ligatures", in the sense they are arbitrary squiggles to which we apply meaning.

You seem to have done it well enough with at least 64 of them; maybe closer to 70 since you use _, ., , and ".

Don't let a few more ruin your day. A few more, I might add, that you don't even have to use.


A ligature is more functional than not using one. They obscure the code for about 5 seconds the first time you see them, and then never again. After those 5 seconds, you register a new semantic symbol in the brain. It is objectively easier for your brain to parse a single arrow symbol than it is to parse => in a monospace font. For the latter, you are scanning two symbols and only after seeing them both can your brain put them together into a semantic meaning. This is strictly worse than just seeing an arrow symbol and understanding it is an arrow.


> It is objectively easier for your brain to parse a single arrow symbol than it is to parse => in a monospace font. For the latter, you are scanning two symbols and only after seeing them both can your brain put them together into a semantic meaning.

Brain is really good in parallel processing of letters/symbols as units. I very much doubt that it's "objectively better". See https://docs.microsoft.com/en-us/typography/develop/word-rec... for overview of the research in this area.

For me the problem with ligatures is not so much of recognizing them but reproducing. I know that for arrow ligature I have to have = and >, but there may be ligatures that I might not be sure of how they're formed. Also, when reading the same code in different environment where the same font is not available I get different visual output where not only is the base shape of the letters different but code units as well. For example three lined equals ligature that some fonts produce. I really hate it.


If your programming language wants to use an ⇒ symbol there's a perfectly good codepoint for that already. I don't want complexity to be hiding in my font where I would never even think to look for it. (For example imagine searching the documentation to understand a use of ⇒ and finding it doesn't exist in your programming language)


My programming language doesn't want to use it; I do. If you would "never even think" to realize that ⇒ in your editor is actually =>, after having installed a programming ligature font where that is always advertised, that's on you. And any developer should already be well aware that no common language uses symbols beyond ASCII, so seeing ⇒ should be clear enough already that it's a ligature. I really think this 'confusion' argument is made up and has never actually occurred for more than 5 seconds.

Semantically, the language would like to use a ⇒, because it's representing the idea of an arrow. It's only due to keyboard constraints that it has use use =>. Parsers (and our brain is also a parser) would be much easier to implement if meaning didn't have to derive from symbol combinations like =>, !==, <!--. The input interface is limited to ascii to represent meaning, but our eyes don't need to be.


> If you would "never even think" to realize that ⇒ in your editor is actually =>, after having installed a programming ligature font where that is always advertised, that's on you.

Sounds like we agree that a font that does this should never be a default. I don't think customized environments to the extent that one developer sees a different view of the code from another are a good idea (partly because I think reviewing and pair-programming are very valuable), but I guess if you want to set up something like that it's fine as long as you're not pushing it on anyone else.

> And any developer should already be well aware that no common language uses symbols beyond ASCII, so seeing ⇒ should be clear enough already that it's a ligature.

I've been using ⇒ in Scala for over a decade, shrug.


I agree it should not be a default. I think much like using the keyboard to navigate the IDE, it's something you can do that brings a benefit once you're familiar with the basics. I don't think vim should be the default terminal editor for the same reason, but I still think vim is worthwhile to use.


> no common language uses symbols beyond ASCII,

Ruby and scala allow using such characters, and there are libraries that use it. Julia actually has special characters in the standard library, although afaik they all have ascii aliases. The repl and many editor plugins support expanding tex style escapes to those special characters.


I use Fira code, and the ligatures for >=, <=, !=, ==, and -> make it so much faster and easier to identify the symbols.

I wouldn’t know where to get the “⇒” codepoint, and getting is probably more effort than just writing “==>” with the added benefit of my teammates not having to use the ligature (or figure out the symbol) if they don’t want to either.


If this wasn't a discussion about monospace fonts, I might be inclined to agree with you. However, I kinda agree with the detractors here; ligatures objectively defeat the purpose of equally-spaced characters. The purpose of monospace fonts is to provide definitive clarity where sans and serif fonts fail to do so. In the world of programming, maintaining that consistency is essential. Having one symbol span several spaces undermines that clarity, you may as well be reading your code with Helvetica at that point. I understand that programming is a career path filled with creature comforts and obscure little things that make you happy; I even enjoy the warp cursor (gasp!) in VS Code, which definitely doesn't contribute to clarity. Let's stop treating ligatures like a direct upgrade over normally printed monospace, though. It's an option, one that shouldn't come enabled by default but one that should be available for people who want them for whatever reason.


Monospace fonts are used mainly because vertical alignment is desirable, and because characters such as ! and . are too narrow to easily read in proportional fonts. Monospace, then, improves clarity. Turning a => into a ⇒ does not affect the vertical alignment nor make anything too narrow to read. It just turns a combination of symbols into its semantic meaning. It allows you to parse a meaningful glyph rather than using a hacky workaround to represent meaning via ascii. This is also the point of emojis: (-_-) is fine, but most people find <expressionless face emoji> to be more clear as to the meaning. Nobody is getting confused about what these ligatures mean. They installed the fonts and selected the fonts in their IDE; they have already been coding; they are not going to see ⇒ where a => used to be and have a brain meltdown.


Is ligature rendering context-sensitive? If I put => in a string literal in JavaScript/TypeScript and the IDE "helpfully" decides to apply ligature to it, I'm gonna go insane.




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

Search: