6 ms·
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
by rychco 4y ago
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)
- s__s 4y agoMy terminal emulator of choice (kitty) lets you configure it to render ligatures only when the text is not under the cursor. I’ve found this to be the best of both worlds. I like reading code with ligatures but would always get tripped up when editing.
- memorable 4y agoIMO 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.
- wildrhythms 4y agoI 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. [1] https://fsd.it/shop/fonts/pragmatapro/ https://fsd.it/shop/fonts/pragmatapro/
- np_tedious 4y agoYou expect that exactly because (like me) you've been seeing it for a long time. I suspect the age correlation parent suggested is a big factor
- pmarreck 4y agoI don't know about this claimed correlation- I'm 50 and love ligatures
- AeroNotix 4y agoIt's almost like there are different people who like different things and it's impossible to turn a subjective thing into an objective thing.
- alrlroipsp 4y agoNah, I heard someone on the internet saying it was an age thing.
- angio 4y agoAlso 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).
- kibwen 4y agoNote that PragmataPro offers both ligature and non-ligature styles.
- brokenkebab2 4y agoIt'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
- rbanffy 4y agoTrue, 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.
- toastal 4y agoPureScript and Haskell <> is concat in most Preludes. However, both languages allow you create your own infix operators and you can use Unicode.
- brokenkebab2 4y ago>If we take ligatures seriously, we’d need them to be language-aware to select the appropriate concept. It's possible in Emacs: to enable relevant ligatures for an active mode.
- bovermyer 4y agoI'm the opposite - I love the ligatures precisely because of their readability. For context, I'm 40, and spent decades programming without them.
- chrisweekly 4y agoSame. 47, only started using ligatures this year (in MonoLisa) and love em.
- onetom 4y agoI'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...
- kitsunesoba 4y agoApproaching mid 30s here, been writing code in some form or another for a couple decades and I enjoy ligatures too.
- toastal 4y agoYou're not alone. Some typographers agree: https://practicaltypography.com/ligatures-in-programming-fonts-hell-no.html https://practicaltypography.com/ligatures-in-programming-fon... With a userstyle you can turn off ligatures in your browser for code blocks. The trend isn't just editors, but some developers want to push it on their audience in their blog too. https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant-ligatures https://developer.mozilla.org/en-US/docs/Web/CSS/font-varian...
- unsafecast 4y agoThe first link doesn't work, looks like you need to replace '.HTML' with '.html' to get the right thing.
- toastal 4y agoFixed
- kibwen 4y agoI 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.
- craftkiller 4y agoCombining `->` into unicode arrow still would require parsing the code to do properly. For example, in firacode this C code: int x = 3; if (x<-5) { return 1; } Renders as: int x = 3; if (x⬅5) { return 1; } which makes no sense.
- dorfsmay 4y agoTotally 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 ===.
- shagie 4y agoUnicode operators can make it difficult if you can't (or don't know how) to type certain characters. https://docs.raku.org/language/unicode_ascii https://docs.raku.org/language/unicode_ascii just kind of rubs me as the wrong way to go. 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)
- lizmat 4y agoThat 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 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. Finally, the Raku documentation also contains information on how to type these unicode characters on your OS: https://docs.raku.org/language/unicode_entry https://docs.raku.org/language/unicode_entry .
- sbf501 4y agoSame 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.
- SPBS 4y agoEspecially 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.