5 ms·
Geneva. I don't understand why programmers use monospace fonts, other than some kind of tradition.
by davewiner 12y ago
Geneva. I don't understand why programmers use monospace fonts, other than some kind of tradition.
- yangyang 12y agoAlignment probably more than anything, though obviously the necessity for that depends on the language and style.
- iopq 12y agoI actually tried a programming font that is not monospace and it's not an issue. Left side is aligned the same anyway and I don't care if lines don't align on the right side.
- GnarfGnarf 12y agoThat is an interesting observation. Perhaps it is due to habit. After 45 years of programming (started with punched cards), I am accustomed to fixed-pitch fonts. Proportional fonts for code seem unintelligible to me. It is worth noting that all quality programming publications display code in fixed pitch. Knuth, in his epochal "Art of Computer Programming", uses fixed-pitch serif for source code. Petzold's "Programming Windows" uses fixed-pitch, as does Kernighan & Ritchie's "The C Programming Language".
- davewiner 12y agoI also use monospace font when publishing bits of source, it helps set it off from the rest of the text. But in the code itself, this isn't a consideration.
- thaumaturgy 12y agoBecause I work with data pretty often, and working with data pretty much requires a monospace font, and there's no reason for me to switch back and forth. For example, cli mysql wouldn't be too much fun in Geneva. There's a nice visual hint between labels and data in lines of whois output, and that hint would be icky in a proportional typeface: status: reallocated owner: NETLINE PERU ownerid: PE-NEPE4-LACNIC Also, log files with columns like timestamp [ip] etc., and some particularly friendly configuration files. And, although it's not very common, I occasionally use it as a typo-checker. If I have a function or a class where I can't easily abstract out some kind of repetition, then using a monospaced font with variables that are the same number of characters lets me visually see right away if I've mistyped something. I couldn't quickly find an example, but it was the first programming-specific monospace font thing that came to mind.