News for hackers. Stuff that matters.
Re:Ligatures in programming fonts: hell no by FridgeSeal on Saturday May 13, 2023 @04:11AM (#35926574)
> 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.

Re:Ligatures in programming fonts: hell no by grzm on Saturday May 13, 2023 @04:17AM (#35926596)
> 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 on this hot mess, my main con­cern is ty­pog­ra­phy that faces other hu­man be­ings. So if you’re prepar­ing your code for oth­ers to read—whether on screen or on pa­per—skip the lig­a­tures.

Re:Ligatures in programming fonts: hell no by hakre on Saturday May 13, 2023 @04:28AM (#35926643)
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.

Re:Ligatures in programming fonts: hell no by grzm on Saturday May 13, 2023 @04:31AM (#35926655)
> how many seem to read the text it feels to them touching their privates and need to make themselves vent off.

Not dissimilar to those choosing to highlight the worst aspects of comments rather than addressing them in good faith. Please don't make things worse.

Re:Ligatures in programming fonts: hell no by hakre on Saturday May 13, 2023 @04:41AM (#35926695)
Pardon, then you may have misread along my comment, that was not ill intended, just seeing that the article polarizes.
Re:Ligatures in programming fonts: hell no by Macha on Saturday May 13, 2023 @09:38AM (#35928244)
Is it really that surprising that a post written in a confrontational, argumentative style produces similar responses?
[dead]
Re:Ligatures in programming fonts: hell no by tptacek on Saturday May 13, 2023 @09:29AM (#35928174)
It is an attack on using ligatures in code. It's not hiding that. That's the point of the article.
Re:Ligatures in programming fonts: hell no by 1attice on Saturday May 13, 2023 @12:51PM (#35930171)
It's not an "attack". It's an argument against. "Attack" implies some sort of animus directed against the recipient; e.g. an attack on unhoused people, etc. An attack implies violence.

An argument, even one with strong language, can be about whether or not a tool is fit-for-purpose. This is allowed. This is discourse.

Right now, politically, a lot of arguments are actually attacks (on specific groups of people) in disguise, and I sympathize with your confusion. But arguments do exist. Not every argument is an attack.

I can't link to this book often enough: https://www.goodreads.com/book/show/29363252-conflict-is-not...

Re:Ligatures in programming fonts: hell no by timsneath on Saturday May 13, 2023 @01:54PM (#35930843)
You can attack an idea. I don't know why you think it assumes animus against the recipient.
Re:Ligatures in programming fonts: hell no by 1attice on Saturday May 13, 2023 @02:25PM (#35931160)
Yes, and you can also shoot, strangulate, or set an idea on fire. Metaphorically speaking.

But metaphor is imprecision and unnecessary colour. Be clear and precise. Use specific language.

This is admittedly prescriptive usage, but I am prescribing this antidote for an overheated era, full of overwrought language.

Re:Ligatures in programming fonts: hell no by akerl_ on Saturday May 13, 2023 @02:35PM (#35931267)
This arbitrary restriction on language seems doubleplus ungood.
Re:Ligatures in programming fonts: hell no by 1attice on Saturday May 13, 2023 @02:45PM (#35931384)
Wait till you read Strunk & White
Re:Ligatures in programming fonts: hell no by nxpnsv on Saturday May 13, 2023 @10:41AM (#35928865)
When I check someones your code and edit it, I get plain text - no ligatures, fonts, highlighting, themes, etc are included. I don't know what dev setup forces visual choices on coders, but that sounds like bad idea...
Re:Ligatures in programming fonts: hell no by grzm on Saturday May 13, 2023 @10:52AM (#35928961)
> if you’re prepar­ing your code for oth­ers to read—whether on screen or on pa­per—skip the lig­a­tures.

Here he's referring to code in books, slide decks, and during presentations, not for editing.

Just below the section the above quote is pulled from, Butterick explains

> One in­spi­ra­tion for this piece was the La­TeX crowd, who would rou­tinely write me to in­sist their ty­pog­ra­phy was in­fal­li­ble. And yet. I kept see­ing La­TeX-pre­pared books that in­cor­rectly sub­sti­tuted curly quotes for back­ticks.... “But code sam­ples like these aren’t really am­bigu­ous, be­cause every­one knows that you don’t type the curly quotes.” ... But many of to­day’s pro­gram­ming lan­guages (e.g., Racket) ac­cept UTF-8 in­put.... So am­bi­gu­ity is a real pos­si­bil­ity. Same prob­lem with ligatures.

Re:Ligatures in programming fonts: hell no by nxpnsv on Saturday May 13, 2023 @01:30PM (#35930598)
Hmm, maybe suboptimal for publishing. That said most publications i read have no code but beautifully rendered equations. I find these more efficient at getting the point across than code… but i guess mileage vary
Re:Ligatures in programming fonts: hell no by hakre on Saturday May 13, 2023 @04:23AM (#35926624)
Just was wondering if today anyone is still using them, so I guess that does not need to be asked.

All right, oh my captain, keep the indents and spacing tight on the monospace and sail along!

Btw., anyone still using monospaced fonts in their editors?

Re:Ligatures in programming fonts: hell no by lionkor on Saturday May 13, 2023 @04:34AM (#35926667)
i program in wingdings
Re:Ligatures in programming fonts: hell no by teo_zero on Saturday May 13, 2023 @05:17AM (#35926834)
> anyone still using monospaced fonts in their editors?

The question is aren't you?

Re:Ligatures in programming fonts: hell no by vonseel on Saturday May 13, 2023 @07:02AM (#35927250)
Doesn't everyone? I can't stand not using monospaced fonts when coding
Re:Ligatures in programming fonts: hell no by hakre on Saturday May 13, 2023 @07:11AM (#35927289)
Just checking ... my current IDE ... not for all parts of the source-code any longer.

I'm not so sure if I want that, maybe I get dumb by it?!

Re:Ligatures in programming fonts: hell no by xupybd on Saturday May 13, 2023 @07:46AM (#35927460)
I tried coding in a variable font. It was horrible. I couldn't read the code. I was shocked at how much my brain made use of the spacing to parse code.
Re:Ligatures in programming fonts: hell no by lucumo on Saturday May 13, 2023 @11:32AM (#35929343)
Yes, same.

It's weird in a way, because there isn't all that much alignment going on in my code[1]. There's indentation, but that still works with a proportional font. And yet, it still looks wrong and hard to read. I can't really figure out why.

[1] I know some people align assignments in multiple lines, or comments at the end of the line, or similar things. I've been working under code style directives that prohibited those because lines changed more often because of whitespace than because of content. Since my work requires me not to do that, I don't have the habit at home either.

Re:Ligatures in programming fonts: hell no by marssaxman on Saturday May 13, 2023 @02:43PM (#35931362)
Code really is not prose! We use so many skinny punctuation marks that have big structural significance, and variable-width fonts de-emphasize them. I want my commas and brackets made clear and obvious, please.

I did actually spend a year or two coding in a variable-width font, back in the '90s, but I switched back after the novelty wore off.

Re:Ligatures in programming fonts: hell no by Zecc on Saturday May 13, 2023 @05:33AM (#35926897)
I don't use ASCII-art often in source code, but when I do (or when I'm reading code from someone who has), I prefer if the characters align correctly.
Re:Ligatures in programming fonts: hell no by hakre on Saturday May 13, 2023 @07:13AM (#35927297)
And then pixel-perfect bitmap fonts.
Re:Ligatures in programming fonts: hell no by loup-vaillant on Saturday May 13, 2023 @07:10AM (#35927285)
> Btw., anyone still using monospaced fonts in their editors?

Tell me you've never programmed without telling me you've never programmed… Almost all code editors and IDEs in current use are set with a monospaced font by default, and the overwhelming majority of programmers keep it that way.

Re:Ligatures in programming fonts: hell no by hakre on Saturday May 13, 2023 @07:15AM (#35927311)
Which brings us back to the point of ligatures which are combining so make a single of what is a double or triple and hence no monospace any longer.

No judgement if that is good or bad or at all. Just a reminder that it ain't monospace any longer.

> Your code is still monospaced in all the ways that matter.

Just it ain't monospace any longer. (reminder)

Re:Ligatures in programming fonts: hell no by MadcapJake on Saturday May 13, 2023 @07:26AM (#35927373)
All coding fonts that do this ensure that the ligatures still fit the same width as the characters that are being combined.
Re:Ligatures in programming fonts: hell no by Izkata on Saturday May 13, 2023 @03:41PM (#35931966)
Nope, the one a co-worker uses combines >= into the space of 1 character.
Re:Ligatures in programming fonts: hell no by xupybd on Saturday May 13, 2023 @07:35AM (#35927407)
Can't it still be mono space if the ligatures take up the same space as their components?
Re:Ligatures in programming fonts: hell no by hakre on Saturday May 13, 2023 @10:36AM (#35928818)
I think that is a stylistic decision to make it appear as if, but again, this ain't monospace any longer.

In monospace one letter/symbol (printable character) has constant width.

The ligature is one letter/symbol. so while the stylistic decision retains the monospace style of the replaced symbols, the ligature itself is double (or triple) sized compared with other symbols.

IIRC this is commonly called "monospaced ligatures" ref https://github.com/tonsky/FiraCode/issues/712

Re:Ligatures in programming fonts: hell no by MadcapJake on Saturday May 13, 2023 @11:42AM (#35929459)
Fixed width is what monospace is intended for and ligatures maintain that feature. Nobody would use them if they caused code typesetting issues.
Re:Ligatures in programming fonts: hell no by hakre on Saturday May 13, 2023 @01:11PM (#35930394)
Whether that is considered an issue or not is merely in the eye of the beholder.

E.g. a compacting ligature for "www" seems to be welcome in some typefaces for coding. But again, only to stress the reminder: It ain't monospace any longer.

We do still may prefer for the typesetting pleasantry that it still is styled as monospace (or fixed width). but those ligatures aren't fixed width any longer as with the letter A, that's all.

This is the difference between what it looks like (two or three glyphs) and what it is (a single glyph). So we break monospace to keep it appearing fixed-width even with the ligatures.

Would be interesting if there is more typesetting theory about the width of ligatures in a monospace font.

Re:Ligatures in programming fonts: hell no by loup-vaillant on Sunday May 14, 2023 @01:46PM (#35939785)
Here's how monospace ligatures work in real life: the width of a glyph is strictly proportional to how many ASCII bytes it represents. A 1-byte glyph like `m` gets 1 cell. A 2-byte glyph like `->` gets 2 cells. A 3-byte glyph like `===` gets 3 cells.

1 ASCII byte, 1 cell. That way ligatures don't change the width of the original text. If a line used to require 42 columns, it still requires 42 columns. That's why we call them "monospace": each ASCII byte requires the exact same width, even when it's part of a ligature.

> a compacting ligature for "www" —

Is obviously out of scope. We're discussing monospace ligatures here, not compacting ones.

Re:Ligatures in programming fonts: hell no by dylanowen on Saturday May 13, 2023 @07:21AM (#35927346)
Ligatures don't change the spacing. Those 2 monospaced characters still take up 2 spaces but are rendered as 1 glyph. Your code is still monospaced in all the ways that matter.
Re:Ligatures in programming fonts: hell no by amake on Saturday May 13, 2023 @08:59AM (#35927946)
Tell me you've never actually used programming ligatures without telling me etc. etc.
Re:Ligatures in programming fonts: hell no by George83728 on Saturday May 13, 2023 @08:01AM (#35927545)
The only people I've ever seen or heard of using proportional fonts for programming were utterly clueless freshmen newbs who mistook MS Word for a text editor...
Re:Ligatures in programming fonts: hell no by tnzk on Saturday May 13, 2023 @08:18AM (#35927656)
Flash also come with a proportional font by default in the ActionScript editor if I remember correctly. I believe Adobe has changed its mind for other products with scripting support.
Re:Ligatures in programming fonts: hell no by f1shy on Saturday May 13, 2023 @10:09AM (#35928549)
Caution: Stroustrup uses proportional fonts for snippets in the book
Re:Ligatures in programming fonts: hell no by aendruk on Saturday May 13, 2023 @02:24PM (#35931145)
I use proportional Iosevka for most text editing, and just make exceptions per-language, e.g. for popular Ruby coding styles or Markdown tables.
Re:Ligatures in programming fonts: hell no by lofaszvanitt on Saturday May 13, 2023 @07:20AM (#35927338)
Re:Ligatures in programming fonts: hell no by Joeri on Saturday May 13, 2023 @07:53AM (#35927493)
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.
Re:Ligatures in programming fonts: hell no by klyrs on Saturday May 13, 2023 @11:05AM (#35929073)
I once came across a true monospace ligature font. It was the absolute worst. Especially when combining letters like ff, fi, ffi...
Re:Ligatures in programming fonts: hell no by rami3l on Saturday May 13, 2023 @01:27PM (#35930560)
Exactly. I recently started to write some LEAN which uses a ton of Unicode characters and I still use JetBrains Mono with ligatures on. ≠ is 1 unit wide but != is 2 units wide, so it's not that confusing as one might think.

Besides, if someone insists, it's also possible to make a language-specific setting in the editor to disable ligatures in those languages :)

Re:Ligatures in programming fonts: hell no by layer8 on Saturday May 13, 2023 @03:04PM (#35931579)
On the other hand, this is one aspect that makes those ligatures typographically jarring to me. It replaces one compromise with another bad compromise.