News for hackers. Stuff that matters.
Re:Dev Fonts by rvanmil on Friday November 20, 2020 @06:03AM (#25159283)
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.
Re:Dev Fonts by lucideer on Friday November 20, 2020 @06:27AM (#25159416)
The 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

Re:Dev Fonts by gvx on Friday November 20, 2020 @06:36AM (#25159485)
To 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.
Re:Dev Fonts by SamBam on Friday November 20, 2020 @09:07AM (#25160528)
That 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.

Re:Dev Fonts by indentit on Friday November 20, 2020 @08:17AM (#25160147)
But most text editors don't render ligatures if the characters span token boundaries. Sublime Text at least doesn't.
Re:Dev Fonts by systemvoltage on Friday November 20, 2020 @12:30PM (#25162703)
How 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.

Re:Dev Fonts by anamexis on Friday November 20, 2020 @01:47PM (#25163522)
> 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.

Re:Dev Fonts by tshaddox on Friday November 20, 2020 @02:52PM (#25164196)
Well, 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).
Re:Dev Fonts by sigzero on Friday November 20, 2020 @09:12AM (#25160572)
I am not fan of ligatures because of the (although small) mental gymnastics that have to happen when reading code. It's unnecessary.
Re:Dev Fonts by rvanmil on Sunday November 22, 2020 @04:01PM (#25181063)
I got used to them really quickly to the point that I prefer them over regular characters. No mental gymnastics required.
Re:Dev Fonts by elcomet on Friday November 20, 2020 @06:23AM (#25159396)
Can you easily differenciate between == and === with ligatures ? That's one thing that holds me back to trying ligatures.
Re:Dev Fonts by Aeolun on Friday November 20, 2020 @07:44AM (#25159890)
Yes, 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)
Re:Dev Fonts by Measter on Friday November 20, 2020 @07:37AM (#25159843)
Of 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.
Re:Dev Fonts by BrandoElFollito on Friday November 20, 2020 @07:43AM (#25159883)
I just had a look at Fire Code. How do you distinguish -> with ligatures from → (an Unicode arrow)?
Re:Dev Fonts by matthewmacleod on Friday November 20, 2020 @08:10AM (#25160101)
Personally, 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.

Re:Dev Fonts by d3nj4l on Friday November 20, 2020 @07:47AM (#25159928)
The ligaturized -> is two characters wide and is pretty easy to tell apart.
Re:Dev Fonts by kps on Friday November 20, 2020 @09:31AM (#25160729)
So it looks like U+27F6 ⟶ rather than U+2192 →?
Re:Dev Fonts by saurik on Friday November 20, 2020 @09:53AM (#25160957)
Sure, but in a monospaced font both of those arrows would have to fit into the same small box, so 27F6 might be the full width while 2192 would be some partial width, while a -> ligature would be two widths.
Re:Dev Fonts by quarantine on Friday November 20, 2020 @08:00AM (#25160009)
The 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.
Re:Dev Fonts by speedgoose on Friday November 20, 2020 @12:56PM (#25162985)
The Unicode arrow is most likely throwing an error in the linter or compiler and is underlined with a red line.
Re:Dev Fonts by stingraycharles on Friday November 20, 2020 @06:28AM (#25159423)
For 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.
Re:Dev Fonts by yoz-y on Friday November 20, 2020 @06:47AM (#25159547)
yes because === is presented as a three long parallel lines (at least in the font I use, which is JetBrains Mono)