Live data from Hacker News

Ligatures in programming fonts: hell no (2019)

practicaltypography.com

171–180 of 201 posts

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

#171
post #151
post #133

Earlier quoted context omitted.

Yes, exactly, and Unicode has more encodings than UTF-8 so stating it explicitly makes clear which encoding of Unicode that is. Writing only ASCII would not be relaying on Unicode, but on ASCII only. IMHO a bit shortsighted today.

Using UTF-8 but only the ASCII bits, and using ASCII are the exact same activity, however. I don't see how the first is any different to the latter, other than which document you look up to tell you that 00110000 is "0". The difference between an "ASCII subset of UTF-8" parser and ASCII parser is whether the error message on encountering a high bit set to 1 is "Invalid character" or "Character not in permitted ranges…

> Using UTF-8 but only the ASCII bits, and using ASCII are the exact same activity, however.

Which was my point. The encoding might be different. For ASCII 7 bit is fine, for UTF-8 and only ASCII, 8 bits are required and, as you also already point out, the high bit must be set to zero with it.

So the point is to name the encoding (UTF-8) of the ASCII characters.

And the input was portable code, not user input of a program.

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

#172
post #98

> 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…

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.

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 (2019)

#173
post #148
post #142

Earlier quoted context omitted.

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

> ... 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…

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 (2019)

#174
post #115
post #74

I initially had this same reaction. Well, perhaps less stridently assembled, but my initial take on it was the same: that ligatures for coding fonts were objectively dumb. But, I was wrong. In several years of using them now, there has never been even one case of the theoretical "mistaking a different glyph that looks similar to the ligature" or "mistaking a ligature character sequence for a single character". It's n…

My takeaway from this article is that I want to go try Fira Code now.

I like JuliaMono.

The main reason is I find the Unicode support much better. With Fira Code, some Unicode characters have varying widths even though it's supposed to be monospaced, making it sometimes look like a proportional font. JuliaMono doesn't seem to have this issue.

Example with Fira Code: https://i.imgur.com/YqlzgTE.png

Example with JuliaMono: https://i.imgur.com/41aHGVM.png

https://www.programmingfonts.org has a nice list, but besides JuliaMono only one other font on the list retains proper monospacing for less frequently used Unicode characters. You can test this by pasting the example below:

    ⋈ : naturaljoin
    ⋉ : leftsemijoin
    ⋊ : rightsemijoin
    ⟕ : rightouterjoin
    ⟖ : leftouterjoin
    ⟗ : fullouterjoin

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

#175

Earlier quoted context omitted.

It is an attack on using ligatures in code. It's not hiding that. That's the point of the article.

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 d…

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 (2019)

#176
I got some banana bread at work today. Hell yeah.

So it goes to show that waiting for things is, like, worth it.

But there's a lot of bad things in this world, dude.

Like fucking skunks, dude. HELL NO.

Scratching your eye, but it's still fucking itchy. HELL NO.

The fucking Cubs, dude. HELL NO!

Fucking ligatures in fucking programming fonts, dude. HELL! NO!

BUT BANANA BREAD, ON FUCKING WORK, DUDE! HELL YEAH! HELL YEAH, BRO!

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

#177
post #28

Earlier quoted context omitted.

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?

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

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 (2019)

#178

Earlier quoted context omitted.

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 d…

You can attack an idea. I don't know why you think it assumes animus against the recipient.

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 (2019)

#179

Earlier quoted context omitted.

You can attack an idea. I don't know why you think it assumes animus against the recipient.

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.

This arbitrary restriction on language seems doubleplus ungood.

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

#180
post #96

Earlier quoted context omitted.

> anyone still using monospaced fonts in their editors? The question is aren't you?

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.

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.

Post reply on HN