back

by sixhobbits·10y ago·view on hn ↗
"Mono-spaced fonts are an anachronism as far as I’m concerned; text is easier to read when it’s spaced properly. This is certainly true for my text heavy documents, like this article, but I also prefer to code this way."

I've never met anyone who codes without a fixed-width font. Has anyone here tried it? What are your experiences?

8 comments
It was horrible and I stopped as soon as I could.

Proportional fonts are great for reading, but awful for debugging, because character recognition isn't the same process as reading text. Not in my brain, anyway. Typos that I would normally catch before moving on to the next statement went undiscovered until compile time.

I tried it for about a week and went back to monospaced. It wasn't a very pleasant experience. Code and prose are very different things. Special characters are very significant when programming, and tend to run together and be hard to read with a proportional font. Double space indents are hard to follow, and alignment beyond indentation is hard to get right.

It might be workable if you're working exclusively with your own code using tabs for alignment, but that's a luxury not everyone has.

I've met people who do this. It only works in some languages. The status quo is certainly to use a fixed-width font and many people's formatting habits depend on this. Very quickly it isn't worth the trouble. Seeing it in action though I think it will be the long-term outcome. I suspect the use of text to provide structure will subside in the next few decades. We have better user interface tools now. Light table and some others have demonstrated this. In that environment variable names and strings could be rendered in a regular font. I suspect this would be much more pleasant to read if structure was maintained consistently outside the font.
It's works fine if you avoid/work-around ASCII art, use tabs for indentation, and only align code by indentation which has merits when coding even in monospaced fonts.
I learnt to program in 1990s at Glasgow University with the same team who created Haskell. We programmed (in Pascal and Haskell* ) with proportional fonts, bold, italics and tabs. Later we had to use literate style: the essay documents (by now in LaTex) could be run as code was tagged and everything else was a comment.

As I recall, if you handed in a proportional printout your assignment was marked down if marked at all.

With high res screens and beautiful on-screen fonts (on Macs & Suns) it only seemed natural at the time. In my opinion it was the arrival of Linux at home with tiny monitors and low-powered PC (coupled with a slightly macho overemphasis on editing in the command-line and a disdain for GUIs) that took us back to proportional fonts.

Shame.

* Actually, Gofer, Mark Jones's variant. https://en.wikipedia.org/wiki/Gofer_(programming_language)

He uses his editor to work on texts. Then I can understand that he wants to have non mono-spaced fonts. However that would work for the text, not for the code. So there should be a mechanism to make up the code, like with color coding, and use a different font for text if it's just text, not code.
I'd really love to do this, but there isn't a single editor I know of that can do it well. Because, for me, the trick would be to have different fonts and styles to help give the code context. Eg, the line defining a new method should look like a sub-headline, while the contents of a comment should look like a quote, variable names in italics etc.

Editors are definitely starting to get there, with colour support coming along, but there's a long way to go.

For people who would like to test and report back, there is this http://input.fontbureau.com/info which apparently is a proportional coding font. I have never used it. I like my monospace fonts, even for reading.