3 ms·
Since we read code more than we write code, I highly suggest you try out a variable width font in your editor. I've been using a slightly tweaked Avenir for yea
by macrael 4y ago
Since we read code more than we write code, I highly suggest you try out a variable width font in your editor. I've been using a slightly tweaked Avenir for years and I love it. Fixed width fonts were a hack to make displaying code on terminals easier 40 years ago, we've long outgrown any need for them.
- codeflo 4y agoI had a similar thought once, and while I still think the idea is correct, I just haven't found any variable width font for which this works for me. Most fonts have very narrow punctuation symbols. That makes sense for the visual flow of natural language text. But in code, symbols need to stand out just as much as letters. Monospace fonts achieve this perfectly, even if mostly by accident. (BTW this is also the reason why I don't use "code ligatures" -- mashing symbols together is the opposite of what I want to read code clearly.)
- macrael 4y agoThe one that bugs my friend the most is that the minus is a totally different width from the plus in most variable width fonts. Personally I have not found this to be a big problem. Brackets are visible enough and indentation is the main way I see them anyway. I would LOVE to see a serious attempt at a variable width font for coding but already for me the benefits outweigh the drawbacks.
- giraffe_lady 4y agoI'm fine with this in theory and have spent plenty of time running variable width fonts in code editors. In practice their non-alphanumeric symbols like brackets and carets aren't designed and set correctly for the significance those characters have in code. In prose they are meant to be clear enough but unobtrusive, with a fair bit of play between the tradeoffs in either direction being acceptable. It's not an insurmountable problem, probably any skilled typographer could do a great job at it on a given typeface. Probably even just a committed amateur with fontforge could do an acceptable job in a weekend. But I'm neither and I don't know of any "code variant" variable-width fonts yet. Plus the last few years this problem more or less resolved itself for me. There are a number of incredibly high quality code-specific fonts now, plus there are now fixed-width fonts so tightly designed with this in mind they aren't even obviously fixed-width unless you have a practiced eye for typesetting. You can get very close to the same result without giving up aligned columns, which is one advantage that is still fairly relevant.
- macrael 4y agoI would love to see a serious take on a variable width coding font. I have a friend who made some edits to Avenir for me, making the minus as wide as the plus and making spaces that come at the beginning of a line wider to make space-indentation more obvious. I've never had any problems with brackets and carrots but of course these font choices are some of the most personal of coding decisions.
- jrm4 4y agoSeems like "languages" have evolved within a monospace world, or more accurately, as human being design programming languages, few, if any, have done so with proportional fonts in mind, which is likely to make adoption difficult?