Live data from Hacker News

Ligatures in programming fonts: hell no (2019)

practicaltypography.com

91–100 of 201 posts

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

#91
post #87

Earlier quoted context omitted.

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

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)

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

#92
post #87

Earlier quoted context omitted.

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

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)

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

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

#define ≥ >=

You could even compile a bunch of them into a header file.

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

#94
post #87

Earlier quoted context omitted.

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

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)

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

#95
post #88

Earlier quoted context omitted.

Well not all your coworkers will have that especially if you're not a place that does pairing all the time but just as one-offs.

$ nix-shell -p tmate --command tmate Now they have it for a one-off

error: nix-shell command not found

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

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

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

#97

> when triplicate would get ligatures, Powerline characters, and so on. Answer, as nicely as possible: never. Undoubtedly he made an argument for ligatures, but why are Powerline characters in the same basket?

It's a bit ouf of context, the whole sentence is:

> The other inspiration for this piece were the people who repeatedly asked me when Triplicate would get ligatures, Powerline characters, and so on. Answer, as nicely as possible: never.

So the answer is, for the same argument. Not going to happen with that typeface, by the authors design.

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

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

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

#99
post #78
post #53

Earlier quoted context omitted.

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?

A Compose key is the best general-purpose way. For example:

• ≥: Compose > =

• ≠: Compose / =

You can define your own sequences too, if you want. I like to type exactly what I mean, including curly quotes and dashes and narrow no-break spaces and emoji and so on, but often didn’t like the default mappings (if there were any). As an example, I use this for curly quotes (look at the keys’ locations on the keyboard to understand—it’s coherent):

       : "‘"
     : "’"
               : "“"
         : "”"
(The only thing I can think of where I don’t normally type what I’d theoretically like to is hyphens, where I use ASCII’s HYPHEN-MINUS instead of the proper HYPHEN. I’ve never come up with a mapping I like—what with en dash, em dash, minus, &c.—and it’s also too common for fonts to lack a HYPHEN glyph.)

When you’re used to this sort of thing, it comes completely naturally.

Somewhat more information: https://en.wikipedia.org/wiki/Compose_key

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

#100
post #28

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

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...
Post reply on HN