Live data from Hacker News

Ligatures in programming fonts

tinyletter.com

21–30 of 87 posts

Re: Ligatures in programming fonts

#22
post #14

Earlier quoted context omitted.

> they're more expressive of intent. You don't control which font will be used when viewing your source, so nothing extra is being expressed to other people about your intent. Using a font with ligatures in your editor when you program doesn't record anything extra in the source code. > ⇒ I find it strange that you include the proper way of doing this instead of using font ligatures: use the proper Unicode code point…

Unicode sucks for this kind of thing, since it would go on disk. Even if they don't go on disk, you have to figure out how to break them up into multiple characters so they can be edited (so ⇒ must be two characters, which is messy). No, Unicode isn't the answer. It is the answer to deali with someone who isn't using a specific font, like readers on hackernews. Ligatures are a cake and eat it to. To those who don't c…

The fact that they go on disk is a pro, not a con; and the fact that they're one character not multiple is also a pro and a not a con: what's the point of the individual characters? Those were merely introduces as a necessary workaround to cope with input limitations. Kind of like C trigraphs - and nobody uses those because they want to.

Re: Ligatures in programming fonts

#23
Q: Should random people on the internet dictate what you do and like? A: Hell no

I quite like the ligatures that come with Fira Code, and most of the author's issues are not applicable to it.

Maybe they should spend more than 5 minutes trying things out.

Re: Ligatures in programming fonts

#24

Ugh to answer the last line of the author: I have been using them for that long and the up and downsides are very well known to me. He has an subjective opinion about them, states them as facts 'and everyone who thinks differently is just stupid' OK author...

Wow you weren't kidding. I have no opinion on the matter but that's just arrogant.

Re: Ligatures in programming fonts

#25
post #18

I agree with the article, but the arguments the author gives are not quite spot-on. Ligatures render code unreadable, there is no way to see how to enter a particular character sequence that is shown as a ligature. They might beautify code for some individuals, but they should never be used for showing code in an public or explanatory context, like on the web. Some operators are no longer recognisable, a few just loo…

> they should never be used for showing code in an public or explanatory context

This I can definitely agree with.

The readability issue, in my opinion, is fine and coarse grained.

If I'm scanning my own code, having ligatures on is quicker for me to understand and is ultimately more readable. But (and this is a large but), when editing my own code, ligatures are useless and in the way. Thus I set my editor to remove all ligatures on active/highlighted lines.

Re: Ligatures in programming fonts

#26
post #3
post #2

I didn't even know those were a thing But in a monospace font? No. No. No. no. No. Epicly bad plan to use something like that to display code

What's bad about them? (I find the arguments in the link interesting, but not all that convincing)

I work with someone who uses them and I find it impossible to read his screen. Unless you work completely alone, it's a terrible idea.

Re: Ligatures in programming fonts

#27

Ugh to answer the last line of the author: I have been using them for that long and the up and downsides are very well known to me. He has an subjective opinion about them, states them as facts 'and everyone who thinks differently is just stupid' OK author...

Wow you weren't kidding. I have no opinion on the matter but that's just arrogant.

This isn't just some blogger though. Matthew Butterick wrote http://practicaltypography.com/ .

Re: Ligatures in programming fonts

#28
post #22

Earlier quoted context omitted.

Unicode sucks for this kind of thing, since it would go on disk. Even if they don't go on disk, you have to figure out how to break them up into multiple characters so they can be edited (so ⇒ must be two characters, which is messy). No, Unicode isn't the answer. It is the answer to deali with someone who isn't using a specific font, like readers on hackernews. Ligatures are a cake and eat it to. To those who don't c…

The fact that they go on disk is a pro, not a con; and the fact that they're one character not multiple is also a pro and a not a con: what's the point of the individual characters? Those were merely introduces as a necessary workaround to cope with input limitations. Kind of like C trigraphs - and nobody uses those because they want to.

Unicode is a disadvantage for someone who wants to contribute to your code. That person now has to figure out how to write down Unicode arrows, taking her/him out of her/his flow.

Re: Ligatures in programming fonts

#29
post #9

The article lists a bunch of non-issues. Yes, you can create confusion by abusing unicode. But that's not new. C++ allows zero width spaces in identifiers. There's a guy on reddit who uses characters from Canadian Aboriginal Syllabics block to have angle braces in Go identifiers. Yes, they are guaranteed to be wrong sometimes. The big one is the But it's incredibly obvious when they are wrong. So it's not an issue in…

I gifted that guy gold for the sheer audacity of the thing.

Re: Ligatures in programming fonts

#30
post #14

Earlier quoted context omitted.

> they're more expressive of intent. You don't control which font will be used when viewing your source, so nothing extra is being expressed to other people about your intent. Using a font with ligatures in your editor when you program doesn't record anything extra in the source code. > ⇒ I find it strange that you include the proper way of doing this instead of using font ligatures: use the proper Unicode code point…

Unicode sucks for this kind of thing, since it would go on disk. Even if they don't go on disk, you have to figure out how to break them up into multiple characters so they can be edited (so ⇒ must be two characters, which is messy). No, Unicode isn't the answer. It is the answer to deali with someone who isn't using a specific font, like readers on hackernews. Ligatures are a cake and eat it to. To those who don't c…

> Unicode sucks for this kind of thing, since eh go on disk

It going to be hard to express the intent when programming if you never write that expression onto non-volatile storage.

> break them up into multiple characters so they can be edited

Several different methods exist for editing Unicode. (e.g. [1])

> As they are under control of the font, editors don't need special support either.

That's exactly the problem. Most editors used for programming already understand the full syntax for many programming languages, while font-ligatures only match short character sequences. As the article mention, this will incorrectly replace some things that happen to share the same sequence of characters. There are also problems[2] in editors with storage or drawing boundaries in the middle of a ligature. Mapping the correct characters to a replacement glyph is a lot easier when you understand the surrounding grammar.

[1] https://docs.perl6.org/language/unicode_entry

[2] The bug tracker for FiraCode has several reports of

Post reply on HN