5 ms·
I really don't get the current trend of font ligatures for things such as !=. It seems to me you loose the fundamental structure of the code. I get it looks goo
by samwillis 4y ago
I really don't get the current trend of font ligatures for things such as !=. It seems to me you loose the fundamental structure of the code. I get it looks good in screen shots on Twitter but when I tried a font with them it just seems to make me have to pause and think more.
What have others experience been?
- capableweb 4y agoAgree with you, tried it a couple of times and found it more distracting than anything. One gripe is seeing one character, hitting backspace and instead of removing one character, it changes to another character rather than deletes it ("≠" -> hitting backspace expecting "" but instead seeing "!" now).
- masklinn 4y agoI love ligatures. I find that well crafted ones make code look more coherent without detracting in any way from the structure (unlike proportional fonts which I abhor). They're also very useful for languages which have operators which are easy to confuse, like the triple equal of PHP and JS (in which case having a ligature that's really distinct from the double equal is very convenient).
- capableweb 4y agoMonospace font on HN seems to do good enough, at least for me, or you think these are too similar as well? == vs === On my machine(s), the difference is quite obvious, with the space in-between each equal sign and all.
- WorldMaker 4y agoThe difference is obvious when paired together next to each other like that, but the issue with code is often you are looking at examples (often with weary eyes) that are "miles apart" or the only one in a file and trying to spot the difference. The ligatures that stack a third bar vertically across the space of three characters do jump out at you as much more meaningfully distinct in isolation. You don't have to just count width or whitespace, you have a third "clue" to work with, and sometimes that extra "clue" is incredibly important when you are tired and staring a bunch of code you expected to work and has a subtle bug and need to visually spot the subtle bug.
- okramcivokram 4y agoI love them and use them everywhere I can, mostly with JS/TS. I find the code displayed with ligatures more readable, and the only time I notice any overhead is when modifying === to !== or back, when I have to remember that I have to change only the initial character. Having => as arrows instead of `equals+more than` is enough of improvement, for me, that I keep using them, even without all other tiny tweaks that they give you. I used to use "Fira Code", but then I've migrated to "JetBrains Mono" everywhere.
- deleted 4y ago[deleted]
- neilpanchal 4y agoWe wrote extensively about ligatures, pros and cons: https://berkeleygraphics.com/public-affairs/bulletins/BT-001/ https://berkeleygraphics.com/public-affairs/bulletins/BT-001... Personally, I generally agree with you - ligatures add a layer of ambiguity. Toyed around with the idea of "precision ligatures", but it only works a subset of ligatures. It's important to keep in mind that ligatures are at the presentation layer, i.e. when the glyphs are drawn. You can still copy and paste the text, underlying representation is still individual chars. Also, ligatures are optional, so why not; a lot of people love them.
- lionkor 4y agoSlightly off-topic, but why does your site not work in Russia? I'm currently in Russia visiting family, and need to turn a VPN on just for you, as anything else I use works perfectly fine. I sure hope it's not politics, because the last thing I need is fonts to be politically charged.
- c0l0 4y agoYes!! I would so like to have a fontconfig option to just disable ligatures altogether, but afaik, one would have to enumerate ALL fonts that one would like to disable them for in the config file - and that's not feasible. So I mostly live with it, and shake my fist in helpless anger whenever somethings f_cks up my otherwise beautifully monospaced flow with this most damned misfeature of digital typesetting.
- mmgutz 4y ago'===' and '==' in JavaScript code were too similar. Maybe that's been addressed by different glyphs in other fonts, but that was enough to say no.
- WorldMaker 4y agoFira Code and Cascadia Code add an entire third "bar" vertically to the triple equals. It may be subtle at first, but eventually it becomes a massively useful difference.
- Finnucane 4y agoIt seems like a little bit weird to have ligatures in a monospaced font. The whole reason ligatures exist is so that bits of letterforms in closely-spaced type don't crash. That shouldn't happen in a monospace font. If you're just changing the space so that two characters are grouped as a kind of unit, that to me defeats the purpose of using monospace to begin with.
- xigoi 4y agoThe point of using monospace is to make things align. Ligatures don't defeat that.
- twblalock 4y agoThe ligatures are hipsterism and it needs to stop. I've never seen it happen in a professional setting.
- naikrovek 4y agoagree; I don't like it when my computer lies to me about what character is there, and ligatures are designed to do just that.
- xigoi 4y agoOn the other hand, I hate when a programming language lies to me. Why have != when it should really be ≠?
- naikrovek 4y agobecause it isn't "≠", it's "!=". that's what the compiler accepts in most/all languages I know. show me a keyboard made today that can enter that character directly. that character can't be entered directly because the USB-HID spec doesn't specify a keycode for that character. I understand that some people want their computer programming languages to look like APL but we tried that, and it failed. Fortunately or unfortunately.
- xigoi 4y agoIt's written "!=" due to physical limitations, yes, but it means "≠". That's why I want to see it that way.
- naikrovek 4y agoI understand your point, I didn't make that clear. != and ≠ are merely visual representations of a concept, so I understand and agree that preference matters here. the bytes in the file are the Unicode code points for "!" and "=", and that's what the compilers and parsers of the world care about, so that's what I want to see. I don't want my text editor lying to me about the contents of the file. one could argue that showing ≠ does indeed tell you that "!=" is in the file. it will also appear if the Unicode code point "≠" is in the file. you may see the nice symbol you want to see, but the compiler or interpreter will not understand that and will show you an error which you may or may not immediately recognize as the wrong thing. I want my text editor to show me what is actually present in the file.
- deleted 4y ago[deleted]
- Accacin 4y agoI generally don't care, I don't find code easier or harder to read. I do dislike when you go to delete a font ligature and it reverts back, as you expect to delete one character.
- thworp 4y agoSince an editor setup is very personal, it doesn't really matter if other people can't immediately recognize that the ligature is == or != . Personally I love ligatures and find that they help me to immediately grasp code structure since they are unique glyphs. Without them there is a slight delay when scanning things and your brain needs to do lookahead and lookbehind to be sure -> isn't just > or the ! in != isn't a random not.
- WorldMaker 4y agoI'm a big fan of ligatures and it is now a "must have" when choosing a coding font for me. The "fundamental structure of the code" doesn't change, all those same mostly-ASCII code points are there unchanged. (Copy and paste still works. Source control works, obviously.) It's just a presentation thing. There's also an argument (often used most especially by Functional Programming proponents and languages) that the "fundamental structure of the code" is actually the math behind the code and our mostly-ASCII assortment of programming language symbols are the easier-to-type/encode/transmit compromise of the mathematical fundamentals. From that perspective, ligatures are more "fundamental" by better expressing their mathematical underpinnings than the raw text that describes them. > it just seems to make me have to pause and think more A classic Python mantra is that "code is read far more often than it is written". If it might be a little slower to write, but it speeds up reading comprehension, that alone can be a major productivity win, per that mantra. Of course, I think there's a familiarity thing at play here, too. Just like most things we learn, there's an early learning curve where it seems harder to work with something like ligatures because you are unfamiliar with them, but eventually you gain familiarity and are just as fast writing it as you were before.