6 ms·
This looks really nice, too bad it doesn't (and never will) support ligatures. I understand the point the author is trying to make about ligatures in the separa
by rvanmil 6y ago
This looks really nice, too bad it doesn't (and never will) support ligatures. I understand the point the author is trying to make about ligatures in the separate blog post, but boy do I love my ligatures when programming.
- elcomet 6y agoCan you easily differenciate between == and === with ligatures ? That's one thing that holds me back to trying ligatures.
- Aeolun 6y agoYes, it’s fairly obvious. It depends on the font, but my triple comparisons actually have three bars (you can see it in the examples I think)
- stingraycharles 6y agoFor me, I just selectively use _some_ ligatures. There are a few I like (like a lambda symbol instead of `fn` in Clojure), and the rest I just don't use.
- yoz-y 6y agoyes because === is presented as a three long parallel lines (at least in the font I use, which is JetBrains Mono)
- Measter 6y agoOf course. A `==` is two characters long, while `===` is three characters long. Also, with the font I use (Fire Code) the `===` ligature has three lines, making it even easier to distinguish.
- BrandoElFollito 6y agoI just had a look at Fire Code. How do you distinguish -> with ligatures from → (an Unicode arrow)?
- d3nj4l 6y agoThe ligaturized -> is two characters wide and is pretty easy to tell apart.
- quarantine 6y agoThe Unicode arrow looks smaller and is positioned lower, while the ligature has the same size as -> with the dash extended into the 'arrow'. Not that I use this frequently.
- matthewmacleod 6y agoPersonally, it’s never really come up. I have no Unicode arrows in my actual source code. On the occasion it’s in a string literal or whatever the it’s pretty obviously different, because it’s a single-width character as opposed to the double-width ligature.
- speedgoose 6y agoThe Unicode arrow is most likely throwing an error in the linter or compiler and is underlined with a red line.
- lucideer 6y agoThe blogpost makes some good points, but it's extremely selective in choosing examples to support the author's thesis. Mainly in that it ignores many examples of orthographic ligatures that don't fit the author's narrative. A (further deep-)linked blogpost on ligatures in general states: > Ligatures were invented to solve a practical typesetting problem. In the days of metal fonts, certain characters had features that physically collided with other characters. To fix this, font foundries cast ligatures fonts [0] But that's not true. That is why ligatures are used by many foundries more recently, but it's not why they were invented, and it doesn't cover all traditional uses of ligatures. German and French orthography in particular contain a lot of examples that are closer to programming operators in use than the author's "fi" example. [0] https://practicaltypography.com/ligatures.html https://practicaltypography.com/ligatures.html
- gvx 6y agoTo me, ligatures in programming always file like a kind of syntax highlighting if that worked on the character level rather than the token level. Suppose given `difficulty = 3` your editor would highlight the `if`. That's how these ligatures feel to me.
- indentit 6y agoBut most text editors don't render ligatures if the characters span token boundaries. Sublime Text at least doesn't.
- SamBam 6y agoThat doesn't usually happen, though. For example, if you type three '=' symbols in Firas Code or JetBrains Mono, you get ≡, but if you type a fourth '=' it snaps back to '===='. I can invent some odd situations where I get a ligature in the middle of a string, but in actual coding (for me 80% JS, 10% HTML/CSS and 10% Ruby) I simply don't see any incorrect ligatures.
- sigzero 6y agoI am not fan of ligatures because of the (although small) mental gymnastics that have to happen when reading code. It's unnecessary.
- rvanmil 6y agoI got used to them really quickly to the point that I prefer them over regular characters. No mental gymnastics required.
- systemvoltage 6y agoHow do you plan to reverse engineer the underlying keystrokes if you look at some ligature ridden code on a tutorial website? It is nice to read. That's not the only thing we do with code. Ligatures are fine for yourself in a private setting. It's popularity is alarming.
- anamexis 6y ago> How do you plan to reverse engineer the underlying keystrokes if you look at some ligature ridden code on a tutorial website? Copy and paste it in a different font.
- tshaddox 6y agoWell, you just have to learn all the popular ligature forms, just like you have to learn all the popular variations of letter forms (e.g. "a" and "g" both have very different variations that are popular in different typefaces).