6 ms·
Ligatures are amazing, I don't understand why anyone would like ascii "compound versions" of a set of symbols when there are thousands if not many hundreds of t
by arthurcolle 4y ago
Ligatures are amazing, I don't understand why anyone would like ascii "compound versions" of a set of symbols when there are thousands if not many hundreds of thousands of great symbols that were used in older typographic settings that are available for usage.
- spicybright 4y agoMy view: Because languages are defined as those symbols, so why obfuscate it? It would be like collapsing the letters "ch" in english to a new symbol because it's a digraph.
- piperswe 4y agoIsn't combining letters in natural language the original purpose of ligatures?
- bobbylarrybobby 4y agoI think the original purpose was to clean up typography so that e.g., "fi" didn't look too cramped.
- bobbylarrybobby 4y agoA few reasons I don't like ligatures when coding: - It makes me have to think too hard to figure out where the boundaries actually lie between characters when I want to edit. I don't want to think about how many times I'll have to press backspace to delete a single "character"; without ligatures, I don't have to think at all. - With ligatures enabled, I have to remember how to type each character-group (e.g., that != is the same as slashed equals). With ligatures disabled, I can just read it back from an existing example. In other words, ligatures create a separation between what I type and what I see. - It makes it hard to quickly compare my code to examples online that don't use the ligatures because, again, I'm forced to translate between what's on my screen and what's in the file. The only ligatures I appreciate are minor stylistic ones, e.g., raising a colon slightly before a number, adjusting the spacing between two consecutive colons, raising two consecutive asterisks, etc. Changes that don't fundamentally change the code appears but make it a teensy bit more aesthetically pleasing.
- freeCandy 4y agoYour last point on minor changes make a lot of sense. Are there any fonts that do this?
- bobbylarrybobby 4y agoI use Iosevka with just the "kern-dotty" ligatures enabled.
- IgorPartola 4y agoI am with you. When you are inverting your logic and need to delete the ! out of != but you have the ligature version you are prone to making a mistake. Best case, you notice it. Worst case you don’t and create a subtle bug.
- WastingMyTime89 4y agoHow would you make a subtle mistake while turning != into = due to ligatures?
- pluijzer 4y agovar a, b = true; if (a!=b) console.assert(false, "unreachable");
- leshenka 4y agojust aim for the middle of the "=/=". Click right where the vertical line is
- nerdponx 4y agoI personally like font ligatures, but I'd much rather have true Unicode "synonyms". E.g why shouldn't `!=` and `≠` be synonymous tokens?
- phinnaeus 4y agoThis would have to be at the language level, surely. Even comparing "case" is filled with weird complexity, comparing equality in this way seems fraught.
- iamevn 4y agoAbsolutely, my ideal would be for the canonical form in the codebase to just be the abstract token. It would have one or more possible names stored in the codebase. Then each developer would be able to choose the names they'd prefer to see and type in their editors. (Decoupling the name of a code unit from the actual reference to/implementation of it is one of the things I'm really excited about in the Unison programming language.)
- spicybright 4y agoThat would make it extremely difficult to talk to anyone else about the code though, no? You'd have to spend time finding and learning the "common" ground between every fellow developer you talk to.
- tonmoy 4y agoThere could be non-programming use cases where one might need to use != instead of ≠
- lifthrasiir 4y agoLigatures obscure the underlying text, which is a problem when you actually edit it. It is okay to have light ligatures where the original text is retained but refined in style but many fonts with ligatures do too much [1], like rendering `!==` as two lines and a slashed stroke in between (come on, who on earth did think this is a good idea???). I would rather have a Unicode symbol support and automatic symbol substitution instead. [1] https://pbs.twimg.com/media/DKE2QBSUQAEv_dQ.jpg https://pbs.twimg.com/media/DKE2QBSUQAEv_dQ.jpg
- WastingMyTime89 4y ago> come on, who on earth did think this is a good idea??? Me. It’s the 21th century. It’s bad enough I have to use monospaced fonts because people can’t properly tabulate. I will at least have proper symbols rather than weird combination of glyphes.
- lifthrasiir 4y agoI too want proper symbols, but not ASCII approximations disguised by inconsistent ligatures.
- WastingMyTime89 4y agoWriting my previous comment, it suddenly downed on me that I could actually be using a proportional font with ligatures and things would look even better. I need to try.
- madeofpalk 4y agoYou don't have to use a monospace font to write code.
- d_tr 4y agoI am not a fan of ligatures either. The "compose" key would be another option to insert various Unicode glyphs and it exists already. Unfortunately, with monospace fonts many of these glyphs do not look nice to me due to the width constraint. Maybe a "multispace" font would be nicer while still preserving the grid alignment.
- MH15 4y agoLuckily as programmers we can each use a different configuration- I just spent two hours at work trying to get my ligature fonts to show up in a hosted VSCode instance.