4 ms·
It was (is?) pretty fashionable in European programming books for some time. For example, all of Niklaus Wirth's books use variable-width fonts. I also find it
by groovy2shoes 15y ago
It was (is?) pretty fashionable in European programming books for some time. For example, all of Niklaus Wirth's books use variable-width fonts. I also find it unpleasant or even irritating at times.
It's useless to compare programming languages to natural languages. Programming languages are formal languages and require some amount of precision for proper tokenization and parsing. If you misspell a word in English, or forget to capitalize something, or miss a space, people can still read it; if you do the same thing in a programming language, you often get an error. Typographic errors in code stand out better in a fixed-width font than they do in a variable-width one.
- evincarofautumn 15y ago“Typographic errors in code stand out better in a fixed-width font than they do in a variable-width one.” That’s a bold assertion. I would be very interested to see a study that demonstrates this.
- groovy2shoes 15y agoI'd like to see a study, too. Unfortunately, I don't know of any. I do, however, vaguely recall an ergonomic study finding that it's easier (or at least faster) for humans to read text in variable-width fonts. I'll try to find a reference when I get off work. That being said, code isn't the same as text. My own experience has been that a missing or wrong character is easier to notice with a fixed-width font (especially narrow characters), and that extraneous or missing spaces are less obvious. Where those things don't matter too much for human readers, they do matter for computer readers. It's obvious to a human that BubleSort is probably supposed to be BubbleSort, but in a more formal setting there is a distinction.