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?
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.