6 ms·
Can you easily differenciate between == and === with ligatures ? That's one thing that holds me back to trying ligatures.
by elcomet 6y ago
Can 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.