9 ms·
My favorite is Verdana. Yes. A proportional font for programming. In the beginning I hated tabs and white space, until I just got used to it. Now it's much eas
by hmottestad 14y ago
My favorite is Verdana.
Yes. A proportional font for programming. In the beginning I hated tabs and white space, until I just got used to it. Now it's much easier to read my own code. Words jump out of the text because spaces are spaces and "i" doesn't make me doubt for a split second where the word starts and ends.
- alcuadrado 14y agoInteresting, but how do you know if you passed the column 80? how do you work when the coding standards mix tabs and spaces (like tab for indenting, spaces for multi-line aligning)?
- hmottestad 14y agoFirst off I'm a student. Though the last summer job I had people didn't really care that much. Tabs/spaces doesn't really matter much. 80 char width also never been a problem. If it makes sense to have it on a 150 char line, then so be it. If it makes sense to split it up, then do that. The only time I ran into length problems was when I was asked to print my code on A4 paper for an exam.
- alcuadrado 14y ago80 coloumns avoid that (and other) problems. mixing tabs and spaces is strange and IMO should be avoided, but it sometimes happen :( all-spaces FTW
- VLM 14y agoI don't use a proportional font like the OP but graphics art stuff like that is best handled by computer. For example if you do sysadmin scripts in perl and edit with vim and have perltidy installed, its more or less just (esc) :%! perltidy (enter) and it looks beautiful. Gave up on 80 columns a couple years ago. Haven't looked back much.
- Stratoscope 14y agoThose are coding standards designed for monospaced fonts. They work poorly with proportional fonts, but there is a simple solution: abandon those standards. With regard to indenting vs. column alignment, don't do column alignment. Code is an outline. It's not a spreadsheet. Column alignment is not beneficial in most cases, and it wreaks havoc with source control diffs. Is it really better to code like this: double someFunctionName( int index, // counts things SomeType secondParamWithStuff, // fancy object with stuff SomeLongerNamedType third ) // whatever instead of this: double someFunctionName( int index, // counts things SomeType secondParamWithStuff, // fancy object with stuff SomeLongerNamedType third // whatever ) Now sure, the second version may look a bit sloppy if you're used to the first, but it has several real advantages: * Much less horizontal eye movement * No eye tracking across wide swaths of whitespace * Changing one name doesn't require reformatting the whole thing * Since you don't have to reformat, it doesn't generate unrelated diffs * It works equally well in proportional or monospaced fonts Oddly enough, many years ago I switched to the second style, not because I was using a proportional font at the time, but because I was really tired of reformatting multiple lines of code just because I'd refactored one variable or type name. And then some time later I tried a proportional font. My code looked fine in the proportional font, and it was still just as readable in a monospaced font. WRT 80 columns or whatever your limit is, I just don't worry about that. I generally keep my lines quite a bit shorter than that, but if a particular piece of code is more readable with a longer line, I don't sweat it.
- jussij 14y ago> Code is an outline. It's not a spreadsheet. Column alignment is not beneficial in most cases But there are many cases where code works best as a spreadsheet. For example any time you need to initialise an array of structures, that is best viewed using a grid like pattern. > but because I was really tired of reformatting multiple lines of code just because I'd refactored one variable or type name. Any decent editor with smart indenting should eliminate most of that effort. Also if the editor is scriptable editor, it should be possible to create a simple script to semi-automate the task.
- sltkr 14y agoElastic tabstops [1] would work perfectly with proportional fonts. 1. http://nickgravgaard.com/elastictabstops/ http://nickgravgaard.com/elastictabstops/
- anonymous 14y agoOne critique I have of elastic tabs is that you need to read the whole document to know how to lay out just what you see before you. That's not an issue with files up to a couple of thousand slocs, but I've had to work with 60ksloc autogenerated source files and waiting for one of those to be parsed and laid out would be a pain in the ass.
- clhodapp 14y agoAt risk of sounding blunt, I do want to ask: have you tried several fixed-width fonts, or have you just used whichever is default on your system? In my experience, there seems to be no issue seeing where there is a space (not even for a split second) with well-designed fixed-width fonts. In fact, for me, it's more apparent, as spaces tend to be wider in fixed-width fonts, being the width of the widest character.
- hmottestad 14y agoI tried a bunch yes, and was fairly happy with them. Then I read about using proportional fonts for programming and just had to try it. It was a tad weird in the beginning but soon felt much more natural.
- kennywinker 14y ago+1 for proportional fonts. I'm a long time user of Times New Roman in Xcode. I keep TextMate and my terminal monospaced, but for Objective C proportional fonts work perfectly once you adjust. I kindof makes sense because ObjC methods are so wordy, that you would want a font aimed at readability rather than symbols. My Xcode theme is here gor anyone who wanta to try http://objectivesea.tumblr.com/post/3109860705/newromantimesxcode4 http://objectivesea.tumblr.com/post/3109860705/newromantimes...
- platz 14y agoI would love to see list of proportional fonts people are using for programming.
- Stratoscope 14y agoOne thing about font choices is that they will vary depending on several factors: * The pixel density of your display * Rendering method (ClearType, OSX anti-aliasing, etc.) * The size of text you prefer * How sharp your vision is * And of course, personal taste. As a reference point, I'm using Windows 8 on a moderately high-density display for a Windows laptop, at around 140 DPI. I'm old, with less than perfect vision, but it corrects well with my single-vision computer glasses. My favorite font these days, as I mentioned elsewhere, is Georgia. I just find it so easy to read. Other proportional fonts I've tried for coding and liked fairly well are Verdana, Cambria, Rockwell, and Source Sans Pro. The best thing, of course, is to try a few and see what pleases your eyes.
- jussij 14y agoHow do you actually code effectively with a proportional font? Without a monospaced font, column cut, copy and paste operations are effectively eliminated (as nothing lines up vertically) and that is one of the programmer editing constructs I use the most. I could not live without column editing.
- to3m 14y agoLack of column editing always drives me back to monospaced fonts in the end, too. I like the proportional look, but column operations ate just too convenient. (Perhaps I need to make an emacs keyboard shortcut to toggle font type at the press of a key. Then i could quickly switch to monospaced for my rectangular operations. That might work. Wouldn't help for Xcode or Visual Studio though.)
- ygra 14y agoI think it was Eclipse that switched to a Monospace font when entering column selection mode. While having a mode and not a quasi-mode for that operation is highly questionable to me, the automatic switch is a very nice touch. Especially to those who usually use a proportional font.
- Stratoscope 14y agoI'm another proportional font programming fanatic. I have tried just about every plausible monospaced and and proportional font, and the one I keep coming back to is Georgia. On a high-enough resolution display (125DPI or better) with ClearType, I find it easier to read than Verdana or other sans-serif fonts. Georgia is a bit of a radically-proportional font: even the numbers are proportionally spaced! Most proportional fonts have monospaced numbers. I think I would probably like monospaced numbers, but I do like Georgia enough that the proportional numbers don't bother me. I find the same benefit you do: I have an easier time reading my code (and other people's code too). There's a subtle benefit as well: it's completely removed the temptation for me to look for column alignment when there's no need for it. I think monospaced fonts trick our eyes into seeing, and seeking out, vertical patterns that don't really need to exist. Since as I mentioned in another comment, I just don't do column alignment any more (indentation only), that takes away the old arguments about "tabs for indentation and spaces for alignment" and such. It doesn't matter if you use tabs or spaces for indentation; the code will look fine either way. And there's no column alignment to get messed up. I should also mention that I don't have any beef with people who prefer monospaced fonts. I do have a beef with coding standards that only work in monospaced fonts because of column alignment and similar column-oriented formatting tricks.
- ygra 14y ago> Most proportional fonts have monospaced numbers. Most fonts that are worth their money come with monospaced and proportional numbers in both lining and old-style forms. Those can be chosen via OpenType features but I fear most code editors don't allow choice in that matter.
- Karn 14y agoVerdana is great for alphanumeric characters, and a little enhancement of the scope characters/operators makes it perfect for programming: http://i.imgur.com/KCKtUR1.png http://i.imgur.com/KCKtUR1.png
- watty 14y agoLooks interesting, can you link it somewhere please? You've posted this several times but have yet to share. I'm not quite sure of your legality concerns, Verdana can be downloaded in tens of thousands of sites by simply searching Google. Even Microsoft has it freely available: http://www.microsoft.com/typography/fonts/font.aspx?FMID=1817 http://www.microsoft.com/typography/fonts/font.aspx?FMID=181...
- hmottestad 14y agoShare what? What legality concerns? Why would tens of thousands of sites from google be of interest? And of coure microsoft has the font. It's their font afterall. "Verdana is a humanist sans-serif typeface designed by Matthew Carter for Microsoft Corporation" [Wikipedia]
- Someone 14y agoFreely? If you read that page, you'll find it is $30 per typeface or $110 for a family of four, for use on workstations. Few if any people will buy that, though, as the font ships with lots of software (for example, it ships with Mac OS X and Windows)
- leephillips 14y agoAscii art in comments won't work: not acceptable.
- kennywinker 14y agoAh! But I have a hack for that! Xcode handles mixed proportional and monospaced fonts fairly well. Comments are in a monospaced font, everything else is proportional. I assume you were joking, but the issue of ascii art in the comments actually came up super quickly when I switched to proportional fonts.
- Stratoscope 14y agoOh, now that is interesting. I didn't realize it until you mentioned it, but Komodo has a similar feature. You can select monospaced or proportional for any syntax element. I think I will try putting comments in monospaced and see how it works out. Thanks for the tip!
- leephillips 14y agoDoesn't work in console Vim: not acceptable. (67% joking - as you know ascii art in comments is sometimes a real thing.)
- hmottestad 14y agoDoesn't work on punch cards either :( (99% joking)
- Stratoscope 14y agoBut it does work on paper tape. 0% joking. My first summer job was back in 1969 at a company in Phoenix called TransData. We had a program on the Sigma 5 called Ferret, which would copy data and read and punch paper tapes and stuff like that. You'd end up with a lot of rolls of paper tape with your various programs and files on them. The problem with these rolls was knowing which was which. Traditionally you would leave a few inches of blank tape at the beginning and write the file name on it with a pen. When you roll up the tape and put a rubber band around it, you've got the filename right there. This did get a little tiresome though. The paper tape for the ASR33 stored a byte at a time - eight holes that you could punch or not punch before the tape advanced to the next row. So I updated Ferret to punch out the filename in an 8px font that you could read after you rolled the tape up. And I'm almost certain it was a proportional font!