upvote
They always seemed to me like solutions to a nonexistent problem. They make the code less readable, but ligatures exist and they seemed like a cool tech thing to implement, and they might look cool in screenshots. But in practice, in my opinion, they're worse than just having the normal characters. But I guess it's a matter of opinion, no harm in other people using them.
reply
We have studies since ages ago that consistency in code style is one of the most important requirements for code quality.

This goes down to the details like that you should either use spaces over tabs OR prescribe editor config such that the code looks similar on each machine.

Of course this doesn't automatically mean that code ligatures are harmful, but I would be quite wary of using them. At the very least it introduces some friction, not sure if the arguably lower mental load of using real mathematical symbols instead of the ASCII symbols makes up for it.

reply
I'v been coding now for like 15 years and I'm not old enought to understand the debate between spaces vs tabs :)

I guess my IDE choices never surface the issue for me... visually they just look the same. I cannot say which codebase uses spaces which uses tabs. I never even think about it. I just smash tab character and don't care that there have been spaces. Or enter or { and IDE does the indentation. I just choose not to press space 2-4-8-16 times in a row.

Now I hope I won't get bulldozed over by HN crowd...

reply
One of the main arguments for tabs over spaces was always that people wanted to configure how much space a level of indentation makes up on screen.

With tabs pretty much every editor except something like notepad.exe could do it since ancient times, with spaces the editor needs to do a bit more processing, so you were a bit more restricted in editor choice, if you really were bothered so much by the indents chosen in the project.

So it is actually quite similar to the ligature discussion. It would be good if the code looked the same for everybody but now instead of saying "But 8-space indents waste so much space on the screen :(" some people now go "But I don't like seeing things like != or -> instead of modern Unicode symbols :("

reply
Spaces vs. tabs causes a lot of issues for Python programmers who share their code with other programmers. The other place where spaces vs. tabs is an issue is with makefiles, probably one of the most annoying features of POSIX.
reply
I also remember old school bourne shell wanting tabs in some places (case statements?), but bash doesn't have that issue.

These days, I try avoid them outside of makefiles.

reply
Considering the way `/bin/sh` had a bunch of different implementations before POSIX standardization minimized that in the mid-1990s, I wouldn’t be surprised if one of those distinguished spaces from tabs.

That said, the original UNIX V7 implementation of /bin/sh didn’t distinguish different kinds of whitespace:

https://www.in-ulm.de/~mascheck/bourne/v7/

reply
Well, the tabs vs spaces had been mostly resolved and spaces won. But obviously it was never about what physical keys to press, nobody on the spaces side would spam the space bar to indent stuff (except maybe in the unfortunate situations of having to use an editor with no choice of setting the tabulator to emit spaces, or a textfield in a non-editor UI where the tabulator cycles the focus instead).
reply
I'm still in the "tabs for indentation, spaces for alignment" camp. If you adhere to it, it makes your code look nice on any tab size.
reply
[dead]
reply
Typing formulas in Excel

It's too bad spaces won, tabs is just correct I think, since one can configure the tabstop to use any indent size they would like. I'm quite tired of reading 2-space indent. Seems everything has moved this way now except python. I'm even seeing C with it, which is especially jarring. I think the languages that use braces for indentation particularly need 4. Python needs it least, and I can read Ruby because its blocks are delimited by words and it's bad style to write long methods

reply
deleted
reply
Agreed, four is optimal and has luckily been the standard in projects I’ve worked in. Encourages you to avoid deep nesting as well.
reply
I'm in the same boat, I always just press tab and let my IDE or text editor fill in with N spaces.

Granted, I'm also someone who heavily encourages the use of Black as the Python formatter in projects I'm on, specifically because it has no configurable options - can't have a holy war about formats if nothing can be changed.

reply
> "understand the debate between spaces vs tabs"

The reason spaces won is that it's not (spaces) vs (tabs), it's (spaces) vs (tabs AND spaces).

reply
Oh, for Pete’s sake. The bodies from this holy war are barely cool…
reply
When I program or I write maths I see and think of -> >>= <*> etc as a single, semantically meaningful symbols. Not only do I use a ligature for them, but I make my keyboard to use one single key. For the same reason I have a key emitting “forall” which Emacs then displays as ∀.
reply
They don't detract from readability for me, so it's just pretty symbols = me more happy
reply
[dead]
reply
Common complaint.

Personally, I like them. They look pleasing and I never had issues distinguishing between the ligatures for ==, ===, and = itself.

reply
I thought I was the only one! I figured I was either crazy or getting old and stuck in my ways. The first I'm I saw a font with them, I thought it was cool and tried it out. I almost immediately hated it. I've tried a few more times for varying lengths of time, and I've decided that I really do hate them.
reply
I have used Fontforge to remove all ligatures from a programming font; e.g. my monospace font of choice is a aggressively subsetted variant of Fira Code with no ligatures whatsoever.

https://github.com/samboy/CaulixtlaFonts/tree/main/MiscFonts...

reply
Can't you just use the font feature flags?
reply
In a lot of places, no.

For example, ligatures in Fira Code cannot be disabled when using the Cygwin terminal in Windows (mintty). In that application, for example, “===” looks like three continuous long lines atop each other in Fira Code, with no way to make it look like three equal signs again.

reply
Isn't FiraCode without the ligatures just FiraMono?

https://en.wikipedia.org/wiki/Fira_(typeface)

reply
There are some notable improvements, most visibly the slash in 0.

From https://github.com/tonsky/FiraCode

“Fira Code is not only about ligatures. Some fine-tuning is done for punctuation and frequent letter pairs.” Note that without ligature support, a lot of that fine tuning is lost.

reply
Fair enough
reply
I logged into HN to upvote your comment. Code Ligations are an absolute abomination.
reply
I like them and use them. But every editor I worked with has an option to disable ligatures.
reply
I wish editors had the option to disable certain ligatures. I use jetbrains mono, and the >> ligature breaks bracket highlighting in visual studio, making them both the same colour
reply
Ligatures suck. That's what Iosevka Fixed is for.
reply
The VT-340 didn't support ligatures, therefore, we shouldn't use them ;-)

Now, seriously, a programming font has no (and should never have) awareness of the computer language it's representing. Ligatures make sense if they present meaning in a way easier to read than the non-combined characters. I can't type := in APL and expect the REPL to think it's an attribution arrow (←).

I get APL is a rather extreme language to talk about, but this is one example where ligatures would harm the programmer (unless your editor replaces a ":=" with a "←"). Source code is a very precise language and the choice of characters you use matters a lot. A "<-" doesn't mean "←" unless the language declares so.

reply
I personally like them because (to me) it makes a few symbols less ambiguous. (I use Victor Mono [0], so in my mind things like == and === in that font makes mistakes more obvious to me at least.)

But also... I know I have the minority opinion on this. It absolutely should be opt-in, not opt-out. I think the past decade, I've been told the font tweaks I enable are incomprehensable to everyone I work with. The way I like my IDE fonts is far outside the bell curve (ligatures, cursive variants for some syntax, proportional variants for prose) so the fact that most new monospace code-focused fonts seem to align with my opinions should be concerning to font makers! I like that I don't have to patch a different font's italics into my code font anymore, but common sense says I SHOULD still have to do that!

[0] https://rubjo.github.io/victor-mono#ligatures

reply
ligatures, not ligations
reply
I have no idea why they chose 'ligation' instead of just ligature, but it was jarring every time I encountered it.
reply
Interestingly, they are called ligations on the submitted website
reply
"ligation" is the verb-form (i.e. making something with/into ligatures).

I'm not sure however that the verb form makes all that much sense in the context the website uses it...

reply
English is great at exceptions, but I'm nearly sure anything ending in -ation is a noun. Ligation certainly is.

Ligation is (among other things) the act of applying a ligature. So it does make sense.

reply
Yes, technically it is a deverbal noun, but I couldn't put my finger on that term at the time
reply
Ration can be a verb.
reply
deleted
reply
Yeah, Unicode shipped 35 years ago. If you want a ≠ then use a ≠.
reply
Then you just need a programming language that accepts ≠ as a synonym of !=. But who knows, maybe there is already one?
reply
Rakulang has you covered.

It is aggressive in its unicode support. You want to use vulgar fractions? Or Mayan numerals? They'll work. You want to use mathematical notation like ∈? It works.

You can literally do this:

`my $var = ⅒ + 2 + Ⅻ;`

https://docs.raku.org/language/unicode_ascii

reply
Julia example: https://juliamono.netlify.app/#fnref:zscode

I can't include an example here because VC News strips out math.

reply
Mostly it strips out ‘math variable names that jerks would use to embolden their spam headlines for emphasis’, which is indeed annoying and results in this:

∂ₓₙ = [(₁ ⊗ ʹ) (₂ ⊗ ʹ) ( ⊗ ₁) ( ⊗ ₂)]

And last I checked, BPL is in the same boat.

reply
Or just pipe your source through a sed script that replaces one with the other before compiling/running.
reply
Yes, but why?
reply
[dead]
reply
I wish more languages other than Raku did this. But no, not equal is written as surprised equal. And if something ought to be less or equal, you have to write a fat arrow pointing left. :/
reply
Not true: you can use the unicode equivalent as well:

say 42 ≤ 666; # True

say 42 ≠ 666; # True

say 42 ≥ 666; # False

For a full list, see https://docs.raku.org/language/unicode_ascii#Other_acceptabl...

reply
deleted
reply
But languages are made by older or less progressive people, so of course you can't use ≠ Unicode in your language enforcing ascii
reply
This is brought up in every single thread about fonts that have code ligatures. So no, of course it isn't just you.
reply
I love them. I suppose it's personal preference
reply
The 'fixed' variant disables them.
reply
They are in the tabs vs spaces camp. Choose your preference and walk away, silently. Unless you consider yourself a Real Programmer, in that case, fight to the death about the matter.

(...I also find them annoying to look at, idk why)

reply
I used to hate font ligatures until I discovered Commit Mono (my all time favorite monospace font). They use the ligatures only to adjust spacing and make it look better on a monospace grid. No stupid <=, -> ligatures or anything else.
reply
You and me both. Ligatures are a solution to a problem that monospaced fonts don't have. I don't mind if a mono font uses ligatures to harmonize character spacing/alignment a little bit. But I don't want things like a "proper" greater/less-equal sign; if a font goes so far as to replace >= with ≥, then it's lying to me about what characters are actually present in the file.
reply
They’re “lying” as much as any other character is “lying”.
reply
Care to elaborate? I don’t see what you mean at all.
reply
I hate them. I disable them in every code editor. I don't need to have to guess if it's a double equals or a triple equals
reply
Some fonts use three lines to draw a triple equals ligature. That, and it is, well, triple long. I’ve never had any problems with distinguishing anything with ligatures. They’re nice to look at, and very easy to read once you’re used to them. Skill issue, guys.
reply
The job of a font is to show me the text as it actually is. I shouldn't need to use a "skill" to decode what I'm looking at.
reply
It is common knowledge among most - if not all - civilizations that you do, in fact, need to learn to read in order to know how to read.

Anyway, since you want a direct representation of the text - presumably, you configured your editor to render EOL sequences explicitly, to distinguish tabs from spaces, etc?

reply
[dead]
reply
It's not only you.
reply
Code ligatures look like the final desperate attempt of an aging hipster, a Ruby on Rails and Web2.0 early adoptr (sic), the type to wear thick-rimmed fake glasses and a scarf in the middle of summer, to be cool, as he is riding his old Segway, with a glass of soy latte in one hand and an avocado toast in the other, into the void of oblivion.

I don't like them because I never know what they actually stand for in ASCII.

reply