Live data from Hacker News

Monospaced Programming Fonts with Ligatures

hanselman.com

31–40 of 246 posts

Re: Monospaced Programming Fonts with Ligatures

#32
post #5

Earlier quoted context omitted.

Well, depending on your audience I think it would be a step backward for static display of code since in some cases it isn't clear what to actually type. Fine for experienced audiences but really frustrating for anyone learning. For example, the 'x' in the hex value. Is it a regular 'x' or another character? How about those fat arrows? How are those typed?

If you don't use one of those fonts that support ligatures, you'll see the plain ascii characters. You shouldn't use these fonts if you don't know what kinds of ligatures it supports or how it converts plain ascii characters into a higher form.

I was commenting on the use of these fonts to display code to others, not use while writing.

Re: Monospaced Programming Fonts with Ligatures

#33
Apparently I'm one of the two users of proportionality spaced fonts for coding. I've used this now for five years and I don't understand why developers still see this need to code as if monospaced terminals is all that's available. Especially on large screens with high dpi it reads much faster. It also makes it less awkward to use editor unicode substitution for display purposes.

Re: Monospaced Programming Fonts with Ligatures

#34

I'm mystified how any one finds these more readable. Form over function if you ask me.

Use them for a bit before judging it, don't forget that you've trained yourself to read some character combinations as meaningful.

After using Fira Code for a while, I can say code looks weird without it. Especially plain === and => look really jarring now. The ligatures also help me spot typos!

Regardless of the ligatures, one of the cooler things about Monoid is how it tries to fix kerning problems inherent to monospace fonts:

https://medium.com/larsenwork-andreas-larsen/class-based-con...

https://github.com/larsenwork/monoid/issues/56

Re: Monospaced Programming Fonts with Ligatures

#35
post #33

Apparently I'm one of the two users of proportionality spaced fonts for coding. I've used this now for five years and I don't understand why developers still see this need to code as if monospaced terminals is all that's available. Especially on large screens with high dpi it reads much faster. It also makes it less awkward to use editor unicode substitution for display purposes.

If like me you really like aligning your code proportional fonts are not exactly pleasant to use. I sometimes go out of my way (within reason) to have variables with the same number of letters so that I can align them nicely. A bane of my existence is that "width" and "height" don't have the same number of letters.

An example from some lua code I'm working on at the moment:

    local hi = buffer:bitfield(4,  4)
    local lo = buffer:bitfield(12, 4)

    return bit32.bor(bit32.lshift(hi, 4), lo)
I find that aligning things not only looks better but also makes the differences more obvious. Same code with a proportional font:

local hi = buffer:bitfield(4, 4)

local lo = buffer:bitfield(12, 4)

return bit32.bor(bit32.lshift(hi, 4), lo)

It's not a deal breaker (and the offset is small in this case) but I much prefer the monospaced version. Obviously it might also be "Stockholm syndrome" after decades of coding with a monospaced font, I can't say I've really given proportional fonts their chance.

Also many proportional fonts make it hard to distinguish between Il1 or O0, but I guess you could design a proportional font that doesn't have this issue. What font do you use yourself?

Re: Monospaced Programming Fonts with Ligatures

#36
post #15

I like switching fonts every couple of years just to keep it fresh. My font right now is Iosevka: https://be5invis.github.io/Iosevka/ A font generated from its source code. You can build your own variant. It has ligatures as well. I like that it’s not as wide as many other monospace fonts.

Ooh, that reminds me of Profont (which I used until displays got high enough rez that a pixel font at 9px was just unreadable).

Re: Monospaced Programming Fonts with Ligatures

#37

For some people this might be great but for me this is a total sensorial overload, I tried to use some of these fonts in the past and I just loose track of the code. Did anyone experience the same in the begging and grew to actually like these fonts or was it always a "love at first sight" experience for you that use them?

There was definitely a lot of "whoa!" and distraction in the beginning, especially while typing and watching things transform.

Later I loaded up some JS code I was working in earlier but without ligatures as the terminal I was using didn't support them. It definitely felt oddly verbose, especially the arrow functions.

I can still go either way, but it's mostly lack of ligature support that keeps from adopting it wholesale. Changing one way or another is a tad disruptive.

Re: Monospaced Programming Fonts with Ligatures

#38
post #33

Apparently I'm one of the two users of proportionality spaced fonts for coding. I've used this now for five years and I don't understand why developers still see this need to code as if monospaced terminals is all that's available. Especially on large screens with high dpi it reads much faster. It also makes it less awkward to use editor unicode substitution for display purposes.

After programming in SmallTalk for a while, I'm starting to come round to a similar point of view. I haven't quite made the leap in my day-to-day work yet, but I really am considering it.

Another thing I'm considering to adopt from ST is dropping syntax highlighting. If research on highlighting for natural language can be transferred to code (I'm not entirely sure, but I suspect it might), highlighting might actually be harmful to comprehension. The only thing I'd keep is a slightly lighter colour for comments, as these don't have quite the same status as code. Ideally, I think I'd like to have them deemphasised by moving them off to the margin or something like that, but that requires rather more work than rendering them a lighter colour than the rest of the code.

Re: Monospaced Programming Fonts with Ligatures

#39

That www thing looks like shit. Just, no.

The www was a little weird to look at for me too, but it's the combinations of multiple "-" and "=" that pushed this over into "nope" territory for me.

It's cool that some folks find it better, but it's just not for me

Re: Monospaced Programming Fonts with Ligatures

#40
post #33

Apparently I'm one of the two users of proportionality spaced fonts for coding. I've used this now for five years and I don't understand why developers still see this need to code as if monospaced terminals is all that's available. Especially on large screens with high dpi it reads much faster. It also makes it less awkward to use editor unicode substitution for display purposes.

Personally I use input[0] which is easy to customize before download. If you aren't using a terminal-based editor, I really don't see the point in monospaced fonts either. I've never had an issue distinguishing differences because of the font style.

[0] http://input.fontbureau.com/

Post reply on HN