16 ms·
I wonder what the world would be like if somebody designed a nice variable-width font for typesetting code. It would be different than a font designed for setti
by doty 16y ago
I wonder what the world would be like if somebody designed a nice variable-width font for typesetting code. It would be different than a font designed for setting English, but I wonder if we wouldn't get the same benefits of beauty and legibility.
I mean, it's kinda silly that we continue to program in fixed-width type, given what modern software can do with setting type on the fly...
- Shorel 16y agoThe 'using spaces instead of tabs' issue seems to have something to do with this.
- __david__ 16y agoIt's more than that--I tend to lean towards words with the same number of characters for variable names which helps make things line up. Variable width would kill that too.
- doty 16y agoDo you think that you use fixed width fonts because you use words like that, or do you use words like that because you use fixed width fonts?
- __david__ 16y agoWell, clearly the fixed width font came first in computer programming. So yeah, I'm sure I pick the words because I use a fixed width font. Using a variable width font would pose many problems to the editor and you'd have to have tabs on the "inside" of a line (as opposed to just having them on the front). That isn't necessarily bad, just much different from how I currently currently code. And aligning to a tab stop is not always what I want--you'd need a tab character that didn't mean "go to the next tab stop" but instead meant "line me up with the corresponding tab in the previous and next lines at the minimum possible distance". That seems annoying and probably not worth it.
- xiongchiamiov 16y agoIt gets significantly less silly when you look at code that is meant to be aligned, and isn't in a variable-width font.
- doty 16y agoYou can always align variable width fonts with TAB. Because a tab is frequently equivalent to a number of spaces in a fixed width font, we get religious wars about tabs vs spaces. In a variable width font, I presume you would use only tabs. It mat also be the case that c and c-family languages (or python and python-like languages) are not the best choice for such a typesetting system.
- squidbot 16y agoI tried for a while to use variable width, but I do a lot of data driven work in Lua and find I make 2 dimensional grids quite frequently, and unfortunately, there's no good way to line them up with a variable width font in a text editor if the field sizes change row to row. I suppose one answer would be to have a smarter editor that could imbed tables, ala a word processor, but that's certainly not a workflow I'm used to.
- Hes 16y agoI code in Calibri (variable-width, comes with Vista). I changed a few years ago and never looked back. With proper anti-aliasing and syntax highlighting, it's the perfect font for coding!
- xenonite 16y agousing variable-width fonts is especially great for editing LaTeX code, because no intendations are necessary here. It gives me a WYSIWYG feeling.