Hacker News new | ask | show | jobs
by Ygg2 2547 days ago
To be honest using non monospace font when coding should be be fireable offense.

I mean good luck with diffing that.

3 comments

> To be honest using non monospace font when coding should be be fireable offense.

Unless I'm coding with a wordprocessor that embeds my font choices and forces them on others, why should anyone else care, much less have cause to punish?

> I mean good luck with diffing that.

“Diffing” and “coding” are different code-related activity and aren't constrained to use the same font, so why would my choice of coding font have any effect on diffing?

You right. Diff tools should use fixed width characters as diff operators (em-space, minus-sign, and plus sign are usually the same width in most fonts), but I doubt any diff tool does. It is a shame. The only reason we use monospace fonts as an industry is because that is how we’ve always done it, and now we are stuck there because we fail to think out side of the box (pun intended) when we make our tools.
Monospaced fonts are good for editing. Variable width characters are good for quick reading because they allow you to scan past spelling errors in prose. Monospaced fonts have distinctive 'textures' that make them amenable to detecting symbol identity. Variable width fonts intentionally eliminate that texture and are often optimized for ink density to 'grey out' blocks of text. Arrow keys don't work predictably in variable width text.
There is no reason font designers can’t create variable width font faces that optimize character distinctions and important features while reading code. Many font faces even have settings that allow you to opt into making characters more distinguishable.

You are right about navigating between lines in a variable width fonts. However that is a problem with many text boxes on the web (including slack and github) and I don’t find it that much of a headache. I find it kind of rare that I need to navigate between subsequent lines and maintain the column except maybe at the start of the indentation level.

Not just diff tools. When you write your own code you are constantly diffing against other code. In essence monospace font prevents these kind of small errors.
Merely downvoting your comment should be punishable by a six month revocation of internet access.