Programming With Proportional Fonts?
theodp writes "Betty or Veronica? Mary Ann or Ginger? Proportional or Monospaced? There's renewed interest in an old blog post by Maas-Maarten Zeeman, in which M-MZ made the case for programming with proportional fonts, citing studies that show proportional fonts can be read 14% faster than fixed-width fonts. Try it for a couple of weeks, he suggests, and you might like it too. Nowadays, Lucida Grande is M-MZ's font of choice on OS X, and he uses Lucida Sans on Windows. Helvetica, anyone?"
this guys just trying to ensure the prophecy of the helvetica wars is fulfilled
background: black
foreground: X11:peachpuff or #99CF96
font: X11:10x20 or Monaco 12pt
That's way faster to read than anything on a bleed-your-yeys white background.
TFA is comparing 10pt Monaco with a 12pt font. Put them both at 12pt and Monaco - which is monospaced - the way God intended computer displays to be - wins.
1% APY, No fees, Online Bank https://captl1.co/2uIErYq Don't let your $$$ sit in a no-interest acct.
Microsoft's Consolas with properly tweaked ClearType has been my personal favorite since its release. Another huge improvement to my code screen is changing the background color to a light grey - still not a dark color scheme, but much less glaring than pure white.
MS Comic Sans is simply the best. My code doesn't have bugs, it has bloopers and out-takes.
It's the only way to write real code.
Stick Men
... /. had a thread very similar to this.
And there were a lot of valuable inputs, like
* 1. Make sure that the font's period (.) sign and the comman (,) sign is BIG, to aid in the debugging process.
* 2. Color of the font and background must also complement each others. Too much contrast hurts the eyes. Too little will blur them up and make it hard to see.
There are many other very useful pointers in that thread. If anyone can dig that thread up it would be very very useful for the new crop of programmers.
Reading prose is different from reading code. I'd think that whatever you gain wouldn't be enough to make up for the loss from lack of vertical alignment.
Additionally, which monospaced font you use matters. You need one that's designed to be readable and to make clear distinctions between 0 and O, l and 1, and so on. I use Raph Levien's Inconsolata for coding, and it's excellent (and available under the Open Font License).
On Fedora, yum install levien-inconsolata-fonts.
From what I understand, the way we process written words is based on the idea that each word is a like a "picture" made up of letters. So, the easier it is to identify the picture, the easier it is for us to read. This means that the width and height of letters plays an important part in creating unique pictures. It is for this reason (at least in print) serif fonts are much easier to read than sans-serif fonts. It's also for this reason that ALL CAPS is the most difficult way to read compared to just reading normal text. On this basis alone, it's likely that proportional fonts are better to read because they're likely to create better word pictures.
'If Christ had tweeted the sermon on the mount, it might have lasted until nightfall.' - John Perry Barlow
Speed of reading is not a bottleneck in understanding code anyway, since I am sure it is pretty uncommon to be able to understand code while reading it as fast as you would read a novel.
And there are numerous disadvantages: lack of alignment, smaller punctuation making syntax errors less visible (" '" vs "' " for example), etc., etc.
# cat
Damn, my RAM is full of llamas.
/. is meant to be the font of all knowledge, not the knowledge of all fonts
I have been a user for about 10 years. This ends Feb 2014. The site's been ruined. I'm off. Dice, FU
Monaco is one of them. 0 is slashed and 1, l, I and | are unique.
1% APY, No fees, Online Bank https://captl1.co/2uIErYq Don't let your $$$ sit in a no-interest acct.
What I wonder about is whether the ease of reading attributed (correctly, I assume) to proportional fonts apply to prose, but not necessarily to the kinds of reading needed in programming. When I read code, I'm sometimes looking for single-character mistakes. In a case like that, a proportional font that helps form "word-pictures" might mask an error. In other words, the speed attributed to proportional fonts is for reading comprehension — translating text into thought — but might actually detract from the speed and accuracy of reading for the purpose of editing/finding mistakes.
Lose essential liberties to get temporary safety = get only hassles and security theater.
Are we really in such a hurry when reading code? I'm under the impression that fixed fonts allow us, when we parse code, to see the different elements more clearly because their size is determined by the number of characters. But that's just an intuition. Anyone else has the same feeling?
Human languages have lots and lots of redundancy, such that you can often either screw up letter order, word order, or even drop entire words, and often the full meaning is clear. Visual cues in the form of paragraphs and chapters are added to help guide the reader, but removing them would not render the text entirely incomprehensible.
Computer languages are not as forgiving, and, also, lacking redundancy, far denser. Reading speed is irrelevant because of the bottleneck formed by reading comprehension. Code is rarely read in novel-like linear fashion, but, much more often, flitting from one part of the text to another, navigating through visual cues. Visual cues in the form of often richly structured layout that includes idioms not required by syntax make navigating and comprehending code possible, and removing them although would, in most languages, not change the meaning of the code, would erect a formidable barrier to comprehension. Not using these cues to the fullest to help write clear, expressive and maintainable code is being self-indulgent and shortsighted. Requiring that a particular, and perhaps unspecified font be used for best display, rather than the ubiquitous assumption of monospaced font, is mere vanity.
Remember, when code is written, it is meant not only to be converted into executable machine language, but also to be comprehensible and comprehended by other programmers, or future selves. Clarity of expression is vital.
Put my fist through my alarm clock with its ding-dong death inside my ear. - The Blackjacks.
All code in Stroustrup's "The C++ Programming Language" is presented in a proportional-width font: "At first glance, this presentation style will seem 'unnatural' to programmers accustomed to seeing code in constant-width fonts. However, proportional-width fonts are generally regarded as better than constant-width fonts for presentation of text. Using a proportional-width font also allows me to present code with fewer illogical line breaks. Furthermore, my experiments show that most people find the new style more readable after a short while."
Not only is the font proportional, but it's bold, italic, and serif as well. Now, reading a textbook is of course pretty different from editing on-screen, but I remember reconsidering some of my habits after reading that book. That code ain't hard to read.
Incorrect.
I use proportional fonts (on whiteish background) because I'm a rebel and don't have any nostalgia for black-background-green-text terminals (i.e. I enjoy the increased readability). And contrary to your statement my code is properly tabbed, functions are aligned, everything is indented just the way FSM demands it. I know this because my coworker enjoys his nonproportional black-backgrounded terminal look and our code is interchangeable.
I simply stay away from "clever alignment tricks". I don't align comments up that sit at the end of my code lines, and you know what? Neither should you. They're annoying no matter the font-type because rewriting one line can make you end up re-indenting all the comments in that block and it's just such a silly waste of time. In my world comments go above a line, or even better is writing the code so at most it needs a little Docstring blurp to provide some context.
To recap: I'm glad you're not my boss you goddamned controlfreak. I get to read my code in sparkly pink letters as long as it doesn't affect my output or my coworkers.
VIM renders text-area as a grid. This is compatible with column-area selection, and other features it supports which frankly I use nearly daily. While I've honestly considered using proportional fonts — I've tried living without VIM, switching to Eclipse or IDEA for several months at a time to give the IDE experience a full opportunity. Doesn't work for me, so neither will proportional fonts.
Besides there seem to be more reasons not to use proportional fonts than to use them:
Reasons to use them:
Elastic tabstops solve the alignment problem. "Do what I mean, not what I say" with whitespace is a good thing, particularly when the width of a character can be totally different for every reader. Elastic tabstops aren't implemented in many editors yet (currently available as an optional feature in gedit and Code Browser), but once it becomes more widespread, many more programmers will be free to try out proportional fonts for coding.
Bah, you kids and your unique characters. I use fixedsys, and typing the wrong characters has never been a pr0blem.
I call foul on this.
On paper, you need the extra white to reflect as much reading light back at you as possible.
with a computer display, the light is generated behind the text, so you don't need the sheer volume of light a white background gives you. This was even more true of old CRT displays, but even an LCD backlight produces way to much light to read comfortably. Note that non-backlit displays follow the opposate convention, and really benefit from a light background.
in conclusion, go with what you're comfortable with; what do a bunch of dorks on slashdot know anyway?
The programming environments by Rob Pike use proportional fonts by default. Both Acme (also used by Dennis Ritchie) and Rob's previous text editor Sam (still used by Ken Thompson, Brian Kernighan and Bjarne Stroustrup).
The rio terminal windows also use proportional fonts.
At first (like many other things from the Plan 9 world) the lack of precise control about how everything spaced can be a bit frustrating, but once you learn to stop worrying about it, it can be rather pleasant and liberating to use (good) proportional fonts for writing code.
"When in doubt, use brute force." Ken Thompson
proportional fonts can be read 14% faster than fixed-width fonts
Sounds good, until brain engages, 14% later. can be always flags +10 in my wetware instance of CrapAssassin, unless BeerGoggles is displacing cycles.
I think, with maybe 60,000 hours of reading time under my lengthening belt, I'd have noticed this effect by now, if it applied carte blanch to all modes of reading. The other night I skimmed the 130,000 words supplied in response to the Edge 2010 question "How is the Internet changing the way YOU think?" This was not the cream of their efforts, but there were some interesting topical centers.
My reading speed through this exercise varied by an order of magnitude, depending on signal density. The weird thing is, for some of the longer responses, my subconscious sends notice "nothing to see here" at a skimming speed where I have no clue what words are actually flying past. Every so often, I drop out of warp speed to double check, and sure enough, not very much to see here, by whatever criteria turns my crank, which itself is sometimes elusive to my conscious mind.
I took a speed reading course and read 'War and Peace' in twenty minutes. It involves Russia.
— Woody Allen
I once attended a school where in some dark closet they kept copies of "Duck and Cover" films, as well as a CRM114-vintage machine designed to stretch your saccade, by forcing you to read words in a revealed window with a progressive speed ratchet.
I never did especially well compared to the best of my classmates on the quiz that followed. Had they slowed that stupid thing down to about half the speed they were forcing us to read, followed by an essay question to expound upon conceptual error, distortion, slant, exaggeration, and damn lies, I would have run out of foolscap before completing my task. In critical response, I was an autobahn surrounded by country lanes, yet many of my classmates could read for uncritical comprehension faster than I could. Dangerous skill. (I'm sure for some of my old classmates, whatever dirt path once existed has returned to nature in their adult years, with ample fertilizer from mainstream media, but that's another matter.)
It's no different with source code. You can read for comprehension, or you can read for all possible error, a state of mind where the eyes consume only a tiny fraction of total brain glucose. Critical thought in the candy factory is hard enough when the conveyor flows along at a consistent speed. Neither can I properly type a long sequence of i and l characters worth a damn in a proportional font. My eyes fail to sync with my fingers, and half the letters fall down my shirt.
Nothing impairs reading speed like a tightly written algorithm where every symbol is exactly right. Nothing inflates the volume of symbols violently gouged onto the retina as a chunk of code where no symbol means precisely what it seems to mean.
Personally, I'm not lining up for smaller gouges in greater number.
Perhaps because most displays are sold pre-set to 100% brightness, 100% contrast, because that's what looks shiniest and most vibrant on display, driving sales.
A while back, I experimented, with the assistance of a color calibrator I use for photography (i1 Display 2, and turned the brightness on my LCD to 40%, contrast to 70%.
The result? "Wow, that's so dim. I don't think I could read that..." ... for about an hour. Now it's fantastic. My eyes hurt less, especially when the room is dark, and seem more sensitive (in a good way). Reading online all day, coding... so much more pleasant. Definitely a worthwhile experiment.
This was on reddit today
http://hivelogic.com/articles/top-10-programming-fonts
Just use tabs. If the dork who opens your text file doesn't have his tab stop set for his preferred size then he deserves to see ugly code.
You probably use four spaces, hey? Personally I hate four spaces. Waste of space. Two is the way it was intended to be. But I understand that other people might have different preferences. With tabs we can all be happy.
Now if you could simulate a long persistence phosphor.
It's just not the same without a permanently burned-in login prompt
If a job's not worth doing, it's not worth doing right.
Nonsense. Differing widths of tab-stops only cause problems when people mix tabs and spaces.