Live data from Hacker News

Ligatures in programming fonts: hell no (2019)

practicaltypography.com

11–20 of 201 posts

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

#11
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 them explicitly. :) is mostly similar to although not exactly the same, but :P is definitely nothing like any of .

Edit: apparently emoji don't work here again? I thought they added them?

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

#14
I don't mind the look of ligatures too much in most monospace fonts that have them. However, I use my editor and terminal emulator for a lot more than just editing source code in common programming languages. In every single ligature-supporting font I've tried, there are edge cases where glyphs are combined in a way that don't make sense in context, which is jarring enough to not be worth it for me.

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

#15
post #3
post #2

Much ado about nothing. It's a matter of personal taste. An actual ≠ has a low chance to sneak into the source code, even lower chance to somehow type it by hand. Either way, it would be a syntax error highlighted by any editor. I'd like my code to look nice and I accept the risks.

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.

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

#16
post #8

Practical Typography is a really good website that is worth reading end to end. It's exactly what the name says: a short, straightforward introduction to typography for practical use.

Link: https://practicaltypography.com/

This submission itself is hosted at practicaltypography.com (https://practicaltypography.com/ligatures-in-programming-fon...)

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

#17
> “What do you mean, it’s not a matter of taste? I like using ligatures when I code.” Great! In so many ways, I don’t care what you do in private. Although I predict you will eventually burn yourself on this hot mess...

I've been using programming fonts with ligatures for years. I had wasted several hours because of those stupid bugs when I mixed up O and 0, - and _, but ligatures never caused me any problem. It is obvious when they are there, and you rarely see non-ascii characters when programming (unless you are writing Lean).

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

#18
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.

Yes, terminals today even support emojis!

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

#19
> 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’t notice because you’re using ligatures?”

Is this the most contrived issue ever? Yeah and what if someone runs “find and replace” using Unicode confusables on my codebase? That’s arguably worse and requires no special font features. Plus I suspect most programming languages would throw an error immediately if you used the >= symbol instead of the pair.

If you don’t like ligatures, that’s fine, but there are those of us that do, and our font preference isn’t a threat to you.

Post reply on HN