Live data from Hacker News

Programming with proportional fonts is great

m-mz.posterous.com

1–10 of 52 posts

Re: Programming with proportional fonts is great

#3

When I tried this I liked it, too, but after a week or two gave it up: I write code for others to read, and, sadly, they will be reading it in a fixed-width font.

I'm not sure I understand. Was using a proportional font changing the way you chose to format the code to such a degree that it annoyed people?

Re: Programming with proportional fonts is great

#4
I honestly think fixed width fonts are only used because of fixed terminal widths, and when repeating instructions on separate lines was common enough that the shape of a line being different was a kind of proto syntax highlighting to show you'd done something wrong.

Ultimately, a space is a space in whatever font, so everything still lines up along the left margin nicely.

Re: Programming with proportional fonts is great

#5
"more text in an eye fixation" is not necessarily a good thing for reading code, because code is semantically more dense than regular text. I think one will not be able to absorb all information and therefore not get a faster reading experience due to re-reading. I find the fixed-width font example easier to read, because it appears not as cramped as the proportional-width example, and I can easier get an overview of what the code does.

Re: Programming with proportional fonts is great

#6
post #3

When I tried this I liked it, too, but after a week or two gave it up: I write code for others to read, and, sadly, they will be reading it in a fixed-width font.

I'm not sure I understand. Was using a proportional font changing the way you chose to format the code to such a degree that it annoyed people?

Leading spaces aren't much of a problem, but aligning comments on the right-side is much harder due to the variable widths of each line. And even if you align them in your editor, they'll be misaligned for people who use fixed-width fonts. Does that make any sense?

Re: Programming with proportional fonts is great

#7
post #3

When I tried this I liked it, too, but after a week or two gave it up: I write code for others to read, and, sadly, they will be reading it in a fixed-width font.

I'm not sure I understand. Was using a proportional font changing the way you chose to format the code to such a degree that it annoyed people?

Using a proportional font will break if you try to align code other than using indentation, e.g. aligning assignments.

More examples: http://mysite.verizon.net/astronaut/vim/align.html#Examples

Of course, I really hope nobody's coding like that. I've never seen anyone who's been able to maintain that kind of formatting consistently.

I don't see any reason why proportional fonts shouldn't work for most programming styles. The problem is that most existing proportional fonts aren't very well suited for programming. At the very least, you need a font with unambiguous shapes for similar glyphs, like 1lI0oO`',.;:

Re: Programming with proportional fonts is great

#8
post #5

"more text in an eye fixation" is not necessarily a good thing for reading code, because code is semantically more dense than regular text. I think one will not be able to absorb all information and therefore not get a faster reading experience due to re-reading. I find the fixed-width font example easier to read, because it appears not as cramped as the proportional-width example, and I can easier get an overview of…

Agreed - I don't think the speed-limiting factor when reading code is how fast it transfers from screen to brain. That's totally different with prose, where you often skip over almost 90% of the characters because the choice of words that fit the context comes naturally - not quite the same for function call arguments...

A possible benefit of fixed-width: say you take a for-loop (which you can probably recognise even skipping over 95% of the characters) - now your brain wants to extract the indices at which it starts and ends: it seems to me a fixed-width font makes it easier to predict where you'll find the indices in the given line. (Not sure if that's how my eye-coordination really works, but it feels like it does...)

Re: Programming with proportional fonts is great

#9
i don't know. Taking a clojure example :

    (defn say [word]
      (println "You said"
               word))
This wouldn't be possible without fixed width. Now a lot of languages don't use that kind of indenting a lot, but in lisps it's mandatory.

Also fixed width ensures that you can write code and it will lay in the same way on other computers, regardless of what other fixed width font they're using. That's a big big point i think, since code is most of the time a collaborative effort

Re: Programming with proportional fonts is great

#10
I can't stand proportional fonts for programming. Aside from it being harder for me to read, inability to use any sort of ASCII art, etc, it just feels sacrilegious.

Not to mention my editor of choice (TextMate) fails horribly with proportional fonts.

But then again, I used to feel the same way about anti-aliased programming fonts, and have since switched.

Currently Inconsolata 16pt anti-aliased is my font of choice. It helps to have a big screen...

Post reply on HN