Live data from Hacker News

Monospaced Programming Fonts with Ligatures

hanselman.com

101–110 of 246 posts

Re: Monospaced Programming Fonts with Ligatures

#101
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…

Reading code isn't the same as normal book or news reading. You don't need to actually read the whole code. Most of the time we looking for a specific variable or function call. Syntax highlighting allows you to filter out everything that's the wrong color to find what you're looking for faster.

I've tried to look at code without highlighting and I can't read it because the color gives me additional context (metadata?) about the code.

Re: Monospaced Programming Fonts with Ligatures

#103

> Picking a programming font is like picking a religion. No matter what you pick someone will say you're wrong. Most people will agree at least that monospaced fonts are ideal for reading code and that both of you who use proportionally spaces fonts are destined for hell, or at the very least, purgatory. I guess I'm destined for hell or purgatory then. Hanselman is not alone. I had the CEO of one company look over my…

> For example, it cured the bad habit I had of lining too many things up in columns

I don't like this style either, but it's a style not a "bad habit."

Re: Monospaced Programming Fonts with Ligatures

#104
post #63

Earlier quoted context omitted.

Rotate your monitor 90 degrees. Or even better, get two monitors and have one rotated, and one normal. It ends up looking like a rotated T. Code and web browsing (which is really just walls of text) goes on the tall one, everything else on the other one.

This is my solution at work; I love it. The only caveat is that some font smoothing doesn't work as well on rotated monitors, since the pixels are no longer arranged as expected. Of course, with 4k monitors, it's a non issue (not that I can even realistically drive 2x 4k monitors on my MBP.

> not that I can even realistically drive 2x 4k monitors on my MBP

The new 15" TouchBar MBPs can drive two 5k monitors. It's amazing for work. Seriously.

Re: Monospaced Programming Fonts with Ligatures

#105
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…

> Ideally, I think I'd like to have [comments] deemphasised by moving them off to the margin or something like that

This is one reason I'm a fan of Douglas Crockford's slightly unorthodox style of always beginning comments in column 0, rather than indenting them along with the code. This helps, to a small extent, in differentiating comments from code. Example: https://github.com/douglascrockford/JSLint/blob/master/jslin...

Re: Monospaced Programming Fonts with Ligatures

#106

> Picking a programming font is like picking a religion. No matter what you pick someone will say you're wrong. Most people will agree at least that monospaced fonts are ideal for reading code and that both of you who use proportionally spaces fonts are destined for hell, or at the very least, purgatory. I guess I'm destined for hell or purgatory then. Hanselman is not alone. I had the CEO of one company look over my…

Why did you format the code snippets in your comment in a monospace font?

Also, I'm curious. I want to see how the code looks like. I want to know what are the downsides of monospace and the benefits of proportional. The one you cited isn't too much of a deal, since it is just a habit you can create using monospace still.

Re: Monospaced Programming Fonts with Ligatures

#107
post #43

What sort of application do people use to design fonts and add ligatures?

FontForge[1] is the one I always see mentioned in the open source world. Adobe, being a giant of computer typography, has some proprietary tools.

[1] https://fontforge.github.io/en-US/

Re: Monospaced Programming Fonts with Ligatures

#108

Earlier quoted context omitted.

note you can kinda use ligatures in emacs by doing something like https://gist.github.com/pcstl/2d9b28a74d6f9254586c2d58d54590...

This replaces -> and whatnot with unicode equivalents, right? There are a LOT of problems with that. First and foremost you really do want double character width for these symbols in the iosevka format. Stuff like → is microscopic.

it also seems to adjust the spacing, I have used it with FiraCode and it seems to work correctly. Note my main font is DejaVu Sans, with this I just use the Fira Code symbols for the "ligatures"

Re: Monospaced Programming Fonts with Ligatures

#109
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…

I'm sympatheic to Smalltalk's approach to highlighting, but as long as we're all editing text files that contain multiple classes / functions / methods / etc... colorizing a few tokens (like class/func/let) is still valuable.

Re: Monospaced Programming Fonts with Ligatures

#110

> Picking a programming font is like picking a religion. No matter what you pick someone will say you're wrong. Most people will agree at least that monospaced fonts are ideal for reading code and that both of you who use proportionally spaces fonts are destined for hell, or at the very least, purgatory. I guess I'm destined for hell or purgatory then. Hanselman is not alone. I had the CEO of one company look over my…

> For example, it cured the bad habit I had of lining too many things up in columns I don't like this style either, but it's a style not a "bad habit."

> I don't like this style either, but it's a style not a "bad habit."

Point well taken. But this was just a personal observation. If other people use column alignment, it would certainly be presumptuous of me to call it a "bad habit"!

For me, though, it was just that. I had no real reason for it other than having always done that way, and it was really starting to get in the way. So I was glad to be done with it.

Post reply on HN