Live data from Hacker News

Programming Fonts – Test Drive

app.programmingfonts.org

51–60 of 289 posts

Re: Programming Fonts – Test Drive

#51
post #38

It looks like these are all monospaced fonts. I realize that most programmers use monospaced fonts, but I personally find proportional fonts to be much more readable and pleasing to my eye. I would be really interested in a similar font comparison that included proportional fonts that are suitable for programming. Right now my favorite is Trebuchet MS. This renders beautifully on the high-DPI displays I use, and it h…

Curious. How do you line things up?

> Curious. How do you line things up?

I don't! :-)

I spent many years lining things up. I would write code like this:

  foobar(firstArg,
         secondArg,
         thirdArg);
(For the sake of discussion, assume that those arguments were too long to just put it all on one line, so you would naturally want to use multiple lines.)

Then when I realized that 'foobar' wasn't such a good name, I had to re-align all the code:

  doTheRealThing(firstArg,
                 secondArg,
                 thirdArg);
At some point, maybe 20 years ago, I got really tired of this.

So I thought, "what if I just use indentation instead of trying to line things up in columns?" Which led to this:

  foobar(
      firstArg,
      secondArg,
      thirdArg
  );
And when I renamed the function, I didn't have to move everything around any more:

  doTheRealThing(
      firstArg,
      secondArg,
      thirdArg
  );
Instead of every line changing, only one line changed. [1]

After I adopted this style, I noticed that the code editor I was using at the time supported proportional fonts, so I got curious and tried one - I think it was Verdana.

And sure enough, the code was just as readable as it was before.

If you don't line things up in columns but instead just use indentation, then a proportional font works just as well as monospaced.

[1] Some will say "just ignore whitespace in your VCS diffs, and this won't be a problem." But I want to know about whitespace changes, just like I want to know about any other change.

Re: Programming Fonts – Test Drive

#53
post #44

I'm surprised that the list doesn't mention consolas. It ships default with visual studio and it's so good that I use it on arch Linux as my terminal font and with intellij. It was designed with programming in mind and has some nifty characteristics like a slash through zero. This list also misses out on 'operator mono' which is a well thought out font for programming.

Consolas is a proprietary font, and this list includes only free and/or open source fonts. It does include the similar Inconsolata.

Though Inconsolata was inspired by Consolas, I wouldn't consider it all that similar. For example, the digits in Inconsolata are much closer to the Franklin Gothic model. Also, Consolas has excellent hinting for Windows, while Inconsolata was originally designed with no hinting at all. They're not drop-in replacements.

Re: Programming Fonts – Test Drive

#55
post #31

It looks like these are all monospaced fonts. I realize that most programmers use monospaced fonts, but I personally find proportional fonts to be much more readable and pleasing to my eye. I would be really interested in a similar font comparison that included proportional fonts that are suitable for programming. Right now my favorite is Trebuchet MS. This renders beautifully on the high-DPI displays I use, and it h…

I'm curious to know how you started using proportional fonts for coding. All of the tooling for writing code defaults to monospace, so what started you coding in a different style?

Thank you for your curiosity! My other comment may answer the "how I started" question:

https://news.ycombinator.com/item?id=18958335

But one thing I'm wondering about:

> All of the tooling for writing code defaults to monospace...

Do you have an example of such tooling? One that I'm familiar with is Google's coding standards, which are obsessed with lining things up in ways that only work in monospaced fonts. Is that the kind of thing you're thinking of, or something else? Thanks!

Re: Programming Fonts – Test Drive

#56
post #16
post #9

Earlier quoted context omitted.

Huh. Not to sound cheap, but it really seems unnecessary to me to spend 60 Eur for a font, when I already have really good fonts like Inconsolata in my reach for free. Is font really that important, do you think? This is an honest question, please don't think I'm sarcastic.

That's an average price of a AAA game, right? And what kind of utility do you get from that? Just did a quick check... I bought it in Sept of 2012, 2323 days ago. $70 / (2323 day * 6 hrs/day) = $0.005/hr Did I get my money's worth (and mind you, I paid less than that.. I'm just going by today's prices)? I think I did. It all depends on how you value things.

Not trying to make any value judgement of my own here, but I think the parent was more referring to the marginal cost/benefit of a $60 font compared to some of the free options available.

Re: Programming Fonts – Test Drive

#58
I think a lot of these fonts deserve a little blurb about their history and purpose. For example Liberation Mono (version 2+) and Cousine are fundamentally the same font available under the same SIL Open Font License https://en.wikipedia.org/wiki/Liberation_fonts#Distribution

Personally I use and recommend Liberation Mono / Cousine at 9pt / 12px. I've been using this font for years so it's just ended up what I'm the most comfortable with for both reading and writing.

Re: Programming Fonts – Test Drive

#59
I pretty much standardized on Fira Code over the past few years, although the ligatures seem to delay rendering a bit.

But overall I like that lowercase letters have nice, readable descenders and hints on HIDPI displays, and that my editor now looks exactly the same on Windows and Mac.

Post reply on HN