3 ms·
Many programmers are still committed to manual formatting, or fixed width fonts would have been obsolete already.
by seanmcdirmid 8y ago
Many programmers are still committed to manual formatting, or fixed width fonts would have been obsolete already.
- dxhdr 8y agoFixed width fonts let you quickly parse syntax. Syntax and semantics are equally important when reading code, whereas semantics are generally the only thing you need for understanding the written language. That said, I haven't seriously tried programming using variable width fonts; maybe it's a well-kept secret to digesting code. Or maybe it's like Hemp Milk, there's a reason it hasn't caught on.
- diegoperini 8y agoI don't know if variable width fonts are a help or a disaster but I've been using multiple fonts in a single editor window for quite a while and the productivity boost is huge. My choices are Operator Mono (to typeset keywords and math stuff) and Firecode (to typeset ligatures). You can find my custom Atom stylesheet here if you want to try. PS: The idea is not mine but I can't remember where I read the instructions about this editor setup, so Google is your friend. https://gist.githubusercontent.com/diegoperini/853d54c8873e7b068947587429770fa1/raw/21f83feced50ff281cc30bdc6ad71b5afde01841/styles.less https://gist.githubusercontent.com/diegoperini/853d54c8873e7...
- seanmcdirmid 8y agoThere is actually no evidence for that. Programmers in general seem to be faster with whatever they are used to. I personally have trouble parsing code in fixed width fonts versus proportional ones* because I’m used to the latter and the kerning of fixed width formatting annoys me. Keywords pop out easily with syntax highlighting in any case, making syntax pretty obvious. * to be fair, I’d have trouble with a bad proportional font like Times New Roman, but I’m sure many would have trouble with Courier New on the other side, the specific font matters.
- arama471 8y agowait are you saying fixed width fonts are only useful for manual formatting? because I find they make it much easier to read code.
- seanmcdirmid 8y agoThere is no evidence that fixed width fonts have any advantage. It seems to be a matter of just what you are used to.
- nothrabannosir 8y agoFixed width fonts are used for programming because of cargo culting. I tried programming in serif fonts only after a HN comment suggested it (would never have thought of it myself) and it's fantastic. Very readable. They were right. And you can still manually format code, serif or monospace. Proportional or monospace font choice is orthogonal to formatting. (Edited to be more specific)
- seanmcdirmid 8y agoI prefer a San serif myself. Mono space allows you to do manual alignment, eg if you want ascii art in your code or non standard formatting. Doing this with a proportional font means other people can’t read your code without using the same font.
- PurpleBoxDragon 8y agoFixed with fonts work well when you are using the alt key to work with multiple lines of code at once. This is especially helpful in the middle ground where the lines of code are similar enough that one can easily use a pattern but the extent needed to be written with that pattern doesn't justify creating some tool to automate writing the code.
- andjd 8y agoI strongly prefer coding in normal fonts instead of typewriter fonts. This is the primary reason that tabs are better than spaces. Working with a proportional width font in a space-indented file is always trying.