Live data from Hacker News

Ligatures in programming fonts: hell no (2019)

practicaltypography.com

71–80 of 201 posts

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

#71
post #69

A page that does not load any content with disabled JavaScript: hell no I mean am I the only one that is browsing with completely disabled JS by default? :-D More and more sites don't load anything withnout a JS and I'm not talking about advanced apps like Microsoft Office online...

There are dozens of us! Dozens!

But it's sadly true that more and more pages don't load anything if you have JS disabled. Often, the answer to "is this worth disabling JS for" is no.

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

#72
> The problem? Many of the programming ligatures shown above are easily confused with existing Unicode symbols.

How so? It's either a ligature or a syntax error: weird unicode symbols can't be valid operators and operator ligatures cannot be valid identifiers. The exception would be string literals, though that situation would be quite rare - probably less common than ambiguity due to different but similar-looking unicode characters. Though I agree it mostly makes sense in one's own editor, not when sharing the code.

Meanwhile people don't mind at all that their code may contain invisible characters with variable length that can make cursor movement less predictable and cause syntax errors - tabs.

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

#73
post #69

A page that does not load any content with disabled JavaScript: hell no I mean am I the only one that is browsing with completely disabled JS by default? :-D More and more sites don't load anything withnout a JS and I'm not talking about advanced apps like Microsoft Office online...

> I mean am I the only one that is browsing with completely disabled JS by default? :-D

I have no patience for that. There’s enough frustration in my life without inflicting more on myself.

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

#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 never happened to me, and I have never heard of it happening to anybody else that I know either. If you have a U+2260 in your code, and that's not valid in your programming language but your editor isn't flagging it as an error, then you have way bigger problems than ligatures.

On the flip side, though, it has absolutely made it easier for me to scan and read my own code, and the code of other people. So what I initially thought was "all downside, no upside" turned out to be quite the reverse.

Note the "for me" qualifier, though; I get that not everybody benefits in these ways. YMMV. I like speed metal, avocado toast, ligatures, and Allman brace style. You may not like these things.

But only that last one has any effect on others. If I insist on using my favorite brace style, sure that's annoying if you have to regularly work with my code and you prefer one of the incorrect brace styles like K&R.

But ligatures don't affect you; they just make my life better. Therefore, it's not a topic worthy of controversy, or of trying to tell other people whether or not they should be using them.

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

#75
post #69

A page that does not load any content with disabled JavaScript: hell no I mean am I the only one that is browsing with completely disabled JS by default? :-D More and more sites don't load anything withnout a JS and I'm not talking about advanced apps like Microsoft Office online...

There are dozens of us! Dozens! But it's sadly true that more and more pages don't load anything if you have JS disabled. Often, the answer to "is this worth disabling JS for" is no.

And yet the page renders text fine in both lynx and links in the terminal. I've noticed that with a few of these 'no javascript means no content in Firefox' Web sites.

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

#76
post #73
post #69

A page that does not load any content with disabled JavaScript: hell no I mean am I the only one that is browsing with completely disabled JS by default? :-D More and more sites don't load anything withnout a JS and I'm not talking about advanced apps like Microsoft Office online...

> I mean am I the only one that is browsing with completely disabled JS by default? :-D I have no patience for that. There’s enough frustration in my life without inflicting more on myself.

The problem is that pages today are waaay too bloated and they use JS to download a bunch of unnecessary crap such as various trackers and "analytics" etc. And with the WebAssembly there is even more tracking the page can do (no thanks!).

When I disable JS globally, I genuinely get faster experience on most of the pages.

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

#78
post #53
post #42

Just reading all of this (I haven't used ligatures when coding), but the confusion between a ligature of >= and the Unicode ≥ (U+2265) could be handled by the language parser accepting either to mean "greater than or equal to". Would moving beyond ASCII be that much of a stretch for modern languages?

Modern languages do have unicode operators. See for example Julia[1] and Raku[2] [1] https://docs.julialang.org/en/v1/manual/mathematical-operati... [2] https://docs.raku.org/language/operators.html

That's fun but how do I type them?

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

#79
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?

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

Doesn't everyone? I can't stand not using monospaced fonts when coding

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

#80
post #37

Ligatures are an interesting contrast to Julia programmers' habit of using actual (non-Latin) Unicode characters in their code. It seemed to me that the use of Greek letters and symbols is actively encouraged in the Julia documentation. I think they advise using editors that allow inputting special characters through their LaTeX equivalent (but source files are then saved to disk with the Unicode characters). I am no…

A lot of Julia folks use the JuliaMono font, which has a minimal set of ligatures: https://juliamono.netlify.app/#contextual_alternates (just above this segment, they mention this very article as something they agree with).

I personally don't like any ligatures, especially when people use them in presentations to public like the article mentions. Confusion between operators is rare, but possible, for eg. when using Catalyst (https://docs.sciml.ai/Catalyst/stable/catalyst_functionality...).

> It seemed to me that the use of Greek letters and symbols is actively encouraged in the Julia documentation.

I don't remember getting that sense from the docs, but I may be wrong. The general convention is that Unicode at the level of user code is fine, and a lot of the community (including me) likes it because it makes it much closer to the actual equations and scientific notation we're working with. For libraries, it's strongly encouraged to have ASCII equivalents for any Unicode operators, keywords, etc. that you expose, and all the major libraries do this. The same is true in base Julia as well, every non-ASCII Unicode name has an ASCII equivalent too.

Post reply on HN