News for hackers. Stuff that matters.
Re:Ligatures in programming fonts: hell no by hinkley on Saturday May 13, 2023 @03:19AM (#35926344)
I gotta say I’m a little tired of using * for multiplication. It’s time for programming languages that use Unicode characters for operators, and let the editor replace != with the Unicode slashed equals character. No ligatures, just operators.
Re:Ligatures in programming fonts: hell no by nikolay on Saturday May 13, 2023 @04:08AM (#35926564)
Yes, terminals today even support emojis!
Re:Ligatures in programming fonts: hell no by Animats on Saturday May 13, 2023 @04:15AM (#35926591)
There are really two separate issues here - ligatures in the classic typographic sense, such as æ, and having some way to type mathematical symbols useful in programming, such as ≠ and ⨯, without having cntl-alt-meta-super keyboard combos to remember.

The former doesn't help in programming. The latter is fairly standard for ideographic languages, and has been well worked out for Chinese and Japanese.

Re:Ligatures in programming fonts: hell no by midchildan on Saturday May 13, 2023 @08:48AM (#35927864)
> has been well worked out for Chinese and Japanese.

Not really. Typing CJK text is a tedious and frustrating experience. People cope with it because no one has come up with a better alternative.

Both Chinese and Japanese alphabets have way too many characters to fit on a keyboard. To deal with this, CJK users type in the English spelling and convert it to CJK characters using software called input method editors (IMEs).

The problem is, this conversion process is often not straightforward. Unlike English, CJK sentences don't have spaces in them so IMEs have to guess how to split sentences into words. Then, it has to identify the right words, which is complicated due to the existence of homophones.

To deal with all the ambiguity involved in this conversion process, IMEs rely on predictions to provide users with a list of possible conversion candidates.

This leads to an awful typing experience in which users have to constantly choose from the IME-provided list for every little snippet of text. This is distracting, slows down typing, and makes key presses non-deterministic. To make matters worse, IMEs sometimes get things wrong and users have to get "creative" to work around it.

In comparison, typing English text is a breeze. You can just type what you want directly.

Re:Ligatures in programming fonts: hell no by thuridas on Saturday May 13, 2023 @05:57AM (#35926998)
So now you have:

- A character harder to type

- The same potential confusion

- Code bases with both operators

Maybe programmers just need to know that ligatures exists. If you are programming in Java or Kotlin you know that intelliJ tend to use it.

Of course, if you have code, coping it to an ide with ligatures disabled will be rendered there old way just add it will use your preferred font or color highlighting schema.

So most of the problems are for images like slides.

Re:Ligatures in programming fonts: hell no by hinkley on Sunday May 14, 2023 @02:46AM (#35935886)
No you don’t have a code base with both operators. Either the editor catches it, or you transform the data at commit time, the same with other code formatters. This isn’t a new idea I’m presenting, just a new wrinkle on a very old one.
Re:Ligatures in programming fonts: hell no by sundarurfriend on Saturday May 13, 2023 @06:27AM (#35927099)
> let the editor replace != with the Unicode slashed equals character

Julia editor plugins let you do that - not an automatic replacement, but you can type the Latex for a symbol and press <Tab>, for eg. `\ne<Tab>` to get `≠`.

I suppose there could be an automatic-replacement mode, for those that have exact ASCII equivalents. So that, for eg., the editor replacing `!=` in your code with `≠` doesn't affect anyone else, because they're exactly equivalent and others can continue using `!=` if they prefer that.

Re:Ligatures in programming fonts: hell no by kps on Saturday May 13, 2023 @09:37AM (#35928237)
> I gotta say I’m a little tired of using for multiplication.*

U+2062 is the obvious solution.