I strongly dislike the trend towards ligatures by default in newer fonts. Maybe it’s because I learned without them, but I find that the readability of code is far worse with ligatures.
My personal favorite fonts at the moment are Jetbrains Mono & MonoLisa (both with ligatures disabled of course)
I don't use ligatures only because the font is the wrong level of the stack for doing cute things like this. I could totally get behind e.g. combining `->` into a Unicode arrow, but if I'm writing the string `"->"` then I want that to be displayed verbatim. That requires parsing (or at least lexing) the code, which fonts can't do (and if they could, I'd be horrified). IMO, it should be the responsibility of editors and IDEs to do this sort of visual substitution.
While I realize '…' and '...' are syntactically equivalent, it means that if someone is writing $foo³ and I need to change that to $foo² - I can't do that without changing it to $foo**2 ... and that results in two different styles of code (unicode and ascii) in the same file which means that future maintainer me has more difficulty.
(note: I still don't know how to type ³ - that's me copying out of another file)
That feels to me that you're blaming a poorly implemented editor / IDE for a language feature.
If you use ² and ³ a lot in your work, I'm sure you can install a macro / keybinding / whatever to access them quickly.
And in any other case, https://docs.raku.org/language/unicode_ascii is a bit of a Rosetta stone in the cases you don't know how to type them, because you can copy / paste them from there.
I'm ok with APL doing all its special characters, but if you can write the same syntax in two ways, one of which is much more accessible than the other, then the less accessible way was a poor design choice.
Allowing for two styles for the same syntax can (and will) lead to multiple styles depending on who wrote that line. Conflicting styles (mixing tabs and spaces anyone?) in turn makes the maintenance of the code more difficult and time consuming which is something that is often forgotten in the rush to write code.
Totally agree. The worse is those long equal signs, with my eyesight going as I age I have to take close to a second to decipher if it's =, ==, or ===.
I'm 45 and I was excited to use them at first, but then as I was changing editors/terminal emulators, coding fonts, I couldn't always had them anyway, so I'm not attached to the idea.
I also prefer the lack of them, exactly because they apply to strings and comments too, where they are often undesired.
I write Clojure code most of the time, so maybe that's a deciding factor too...
IMO ligatures makes it easier to recognize common symbols used in programming languages and also doesn't affect readability much. Maybe I am younger, but I don't see the problem here.
I don't like it because it tends to combine two distinct characters into one (visually). A great example is '<=' being transformed into '≤' (Pragmata Pro[1] does this) I expect to see two characters, but instead I see one and expect to see a syntax error.
Also it's incredibly annoying when a language uses `<=` for something that's not a comparison.
Julia was right in allowing developers use unicode for variables and operators, so if you want ≤ you simply use that directly (or type \leq in your editor).
It's not about age. I'm rather oldschool, and I like programming ligatures very much. When => intended to imitate thick arrow, seeing thick arrow instead is reasonable, I think
True, but <> in Perl is called the diamond while, in other languages it means “not equal”. If we take ligatures seriously, we’d need them to be language-aware to select the appropriate concept. And for a font to have to be aware of all languages that can express ideas with it is a violent violation of the separation of concerns principle.
If languages opt to make “≠” equivalent to “!=“, match all styles of open/close quotes, and enable me to attribute a value to a variable using an arrow, that’s great.
In the meantime, I’m not sure they are a net positive in all cases and fear they may drive unfortunate syntax choices for people who design languages.
Especially egregious in technical blog posts when the author uses them because they think it looks nice but then forgets that not everyone knows what those symbols mean. Leave ligatures out of code blocks.
Same here. I was raised on Apple screens, 80x25 EGA and VT100 terminals in the 70's & 80's, so I find ligatures to be wildly annoying and error prone, as well as nonportable: having to mentally switch back and forth on different terminals or code UIs is jarring.
My personal favorite fonts at the moment are Jetbrains Mono & MonoLisa (both with ligatures disabled of course)