←back to thread

50 points fagnerbrack | 6 comments | | HN request time: 0.833s | source | bottom
1. sxp ◴[] No.42189133[source]
Do programmers use those weird font ligatures in practice? E.g, Rendering `a != b` as `a≠b`. I've only seen them used by people who want to show how far they can push coding style away from the standard monospace low ASCII, but haven't seen any good justification for them.
replies(5): >>42189260 #>>42192111 #>>42192596 #>>42194228 #>>42197475 #
2. tkcranny ◴[] No.42189260[source]
I happily use Fira Code [1] with ligatures. It has nothing to do with pushing coding style away from monospace, and everything to do with readability. Aesthetics are certainly a part of it but perfectly compatible with it too.

Of particular note is that the JS arrow function becomes a real arrow ⇒, which is nicer than the operator-ish rendering of equals and a greater than sign. Other quality of life improvements are reshaping ripples of characters to be clearer, such as a reshape to www and **. Triple bar equals is nice too given the differences in JS.

[1] https://github.com/tonsky/FiraCode

3. spoiler ◴[] No.42192111[source]
I use MonoLisa with ligatures and it helps me with reading code. I'm dyslexic so it helps me not go cross-eyed. There's better dyslexic fonts out there, but they tend to be ugly even if it makes reading stuff easier.

Mono Lisa strikes a nice balance. If you want a free version, I think JetBrains Mono is decent too

4. adrian_b ◴[] No.42192596[source]
People who have little experience in mathematics are content with symbols like "!=".

On the other hand, people experienced in mathematics find silly to use a whole bunch of arbitrary composed symbols to replace the traditional mathematics symbols, some of which have been used for centuries, only because a half of century ago the ASCII character set standardized by Americans, for which the priority was its suitability for commercial correspondence written in English, not for mathematical formulae or programming languages, and previously the even more restricted character sets implemented by the IBM peripherals, have forced the designers of programming languages to substitute the classic mathematical symbols with whatever was available.

Now when Unicode is available, it is possible to design a new programming language that uses any desirable symbols.

However the most important legacy programming languages are still specified to use only ASCII, with the possible exception of identifiers. Ligatures allow one to see whatever symbols are preferred, while still delivering to the compiler ASCII text.

This tradition of using very restricted character sets has been imposed on the world by USA, and especially by IBM, to reduce their manufacturing costs in the early years of computer technology. Its consequences have been both the difficulties of using in computer applications the letters with diacritics that are essential for most non-English languages and also of writing mathematical formulae.

In the beginning, the programming languages partially or totally designed in Europe, like ALGOL 60 or CPL, were using much more mathematical symbols than available in the American computers. Because of this, eventually they had to be transliterated in order to be able to make compilers for them that could run on IBM computers or the like.

replies(1): >>42192838 #
5. ◴[] No.42194228[source]
6. LandR ◴[] No.42197475[source]
Yes, a lot.

I use a plug in for vscode that does all sort of substitutions along with ligature.

E.g.

    (reduce + [1 2 3])
Shows as

    (Σ + 123)
Or

    (comp foo bar quax)
Becomes

    (∘ foo bar quax)
Etc, I find the conciseness so much easier to read.

Unfortunately the plugin can be buggy when you hsbe a lot if subs, I'd setup loads if I could. If only someone would fix it / make a version that works.