4 ms·
Go proportionally spaced fonts for code and don't look back.
by seanmcdirmid 13y ago
Go proportionally spaced fonts for code and don't look back.
- ANTSANTS 13y agoLet me know how that works for you if you ever write Lisp, Haskell, or have to deal with someone who thought they could make their $ALGOL_INSPIRED_LANGUAGE look cute by aligning everything into tables.
- seanmcdirmid 13y agoMono space is a type writer anachronism. Lisp was designed in hype 60s and not many people write code in it; Haskell could benefit from better mathematical typesetting. I've heard that going proportional would be bad, but I made the switch and have noticed yet any badly formatted third party code (I mostly use C#).
- edwintorok 13y agoAre you using a serif font? Because sans-serif is very bad when it comes to representing source code: the characters 1lI and 0O all look alike. For example Pidgin's choice of a sans-serif font always caused me troubles, had to either switch the font, or the system-wide sans-serif font to something where I can tell the difference.
- seanmcdirmid 13y agoSegoe UI. Honestly, I knew this would be a problem but I haven't had this problem yet. The most annoying thing is that subtraction (-) is too short in relation to addition (+).
- Silhouette 13y agoIn my ideal world, code would be typeset in proportional fonts, with mathematically appropriate glyphs chosen from a font with a comprehensive Unicode character set, including a proper minus instead of hyphen-minus. The usual problems with this are arranging indentations/alignments neatly where you really do want them and avoiding an explosion of funny characters once you've got a large part of the Unicode character set to play with. Tools are pretty good at the first these days, but pity the poor Haskell developers if we don't fix the second. People will be writing logging libraries that use different levels of emoticon to save writing 'debug' and 'error'...
- rtpg 13y agoHaskell, despite how people talk about it, isn't necessarily that heavy symbol-wise. Table-based aligning makes haskell code look very good (esp. when dealing with a lot of pattern matching)
- seanmcdirmid 13y agoHaskell just looks horrible when set in ASCII at all; where did they come up with \ for lambda? It would definitely benefit aesthetically from at least more Greek use.
- Someone 13y agoIt's two thirds of a lowercase lambda: λ vs \
- seanmcdirmid 13y agoI know, but it's too subtle and makes the code look bizarre. Well, if there were lambdas everywhere, I'm not sure it would look much better...code would begin to feel more like a boring POPL paper.
- baddox 13y agoI'm not against that at all, but it doesn't really work when you're on a shared codebase with people who use spaces to align things based on the assumption of fixed-width fonts. Things like: hash[:foo] = 5 hash[:sdfkd] = "x" hash[:x] = "y" Of course, I'm against doing this anyway, because it causes issues when you want to add an even longer key to the hash.
- subsection1h 13y ago> it causes issues when you want to add an even longer key to the hash What issues? Needing to realign the values? If so, does your text editor not include alignment commands like these: http://www.emacswiki.org/emacs/AlignCommands http://www.emacswiki.org/emacs/AlignCommands
- nitrogen 13y agoRealigning the values causes all of the lines to change in a line-by-line diff (e.g. as displayed by git diff). It also makes "git blame" less helpful, since every realigned line appears to originate from the alignment commit.
- e12e 13y agoI agree -- but I'd think the work-around would be to do whitespace-insensitvie diffs? Which would probably be a good idea if the codebase uses indentation like this? See eg: https://stackoverflow.com/questions/7310033/how-to-make-git-diff-ignore-space-change-the-default https://stackoverflow.com/questions/7310033/how-to-make-git-...
- jacobparker 13y ago`git blame -w` to ignore whitespace. There are other good options (like `-M`, ignore moved lines) available in the documentation.
- alxndr 13y agoI really wish GitHub would show me all diffs with `-w` by default, with a switch to turn it off...
- subsection1h 13y agoDo you create a new spreadsheet using a spreadsheet app every time your notes include tabular data? I ask because a proportional font would be incompatible with the table/spreadsheet syntax of every lightweight markup language I've used. I would hate to have to create a new spreadsheet using Excel every time I have new tabular data for my Org-mode-powered personal wiki rather than simply use Org mode's spreadsheet syntax.
- seanmcdirmid 13y agoI use proportional fonts for my latex editor, and have always been able to align my tables well enough in .tex files. Of course, latex output has no problem aligning table columns without using a fixed width font. Doesn't everyone use latex for note taking?
- grayclhn 13y agoLots of use use something that can export to latex :)
- e12e 13y agoI tend to agree, I use monospaced fonts -- however -- what's wrong with tabs? Surely if you're using variable width fonts, you could pair them with tabs?