5 ms·
To be honest, I never understood all these discussion about "coding fonts". They pop up every now and then here on HN but it always seems like bikeshedding to m
by kleiba 8y ago
To be honest, I never understood all these discussion about "coding fonts". They pop up every now and then here on HN but it always seems like bikeshedding to me.
Don't get me wrong - I'm aware that there are some folks who may have a vision impairment or some other reason where it really matters. But apart from that, I've been programming for decaded on many different computer systems with many different fonts, and frankly, it really doesn't matter too much to me.
Of course, you want something monospace, and something that looks nice might make an 8-hour day job (subconsciously?) more pleasant. But to me(!), most of the "programmer font" discussions are a waste of time, just choose the first one on your system and off you go.
- gedy 8y agoIt's just subjective, but many people are genuinely sensitive to it, some aren't. I find Input visually hard to read, and prefer something like Fantasque Sans Mono (https://fontlibrary.org/en/font/fantasque-sans-mono https://fontlibrary.org/en/font/fantasque-sans-mono). Different strokes.
- iheartpotatoes 8y agoThere are instances where font matters, and I go back to TurboC on my 8086 and Fortran 'scards' on a VMS mainframe + terminal, so I'm not a whiny mod-crazy hipster. > Fonts Creating Bugs: Some fonts are more prone to errors. Lower case L vs number one, zero vs. capital O, braces vs parens, lowercase g vs 9. Go look at old Unix fixed fonts, and even courier and you can see how hard it is to distinguish. (Unix '10x7' was my favorite until horz resolutions crossed the 1600px.) > Readabilty vs. Coding Style causing (literal) Headaches: Staring at code 10+ hours a day, eyes fatigue. Some fonts are noisier than others, some fonts read faster than others, some fonts have more space than others. And, if the coding style of the person you are reading does not use spaces between '=' or '()', or ample newlines, Courier can be a very taxing font due to all the serifs. Lucida Mono provides a nice way out of this, but not all systems have it. Consolas solved the problem for a very long time. > Ligature Bling The addition of ligatures is mostly bling. I tried Firas cuz the => glyphs were nifty, but ultimately a big fat triple equals looks worse than '===' and I'd rather not waste time tweaking my goddamn font! > Proportional What kind of savage codes with a proportional font? > Portability I switched to Consolas because I can use it on Vi on macOS, Win, and *nix, and it saves my eyes from dense programming style.
- zamalek 8y ago> eyes fatigue. Not only that, but it might as well look nice if you're staring at it for 10+ hours.
- stkdump 8y ago> What kind of savage codes with a proportional font? I did for some time. I only switched back because our coding standard limits the length of a line and that is hard to check with a proportional font. I honestly don't get why source code needs a fixed character grid. My prefered code formatting doesn't require lining up things using spaces in the middle of the line. If things need to be lined up, then I put them in the beginning of the line with the apropriate indentation. This way anyone can choose any font they like and make use of the increased readability of proportional fonts.
- kakarot 8y agoI honestly don't get why source code needs a fixed character grid. > Alignment of blocks and assignments. It's that simple. The benefits from the increased legibility and clarity can be quite tangible. Code that is the same looks the same, and it's easier to scan for anomalies.
- Stratoscope 8y ago> What kind of savage codes with a proportional font? I have, for more than a decade. Why do you call me a savage? ;-) I know you're kidding, of course, but now you owe me (and yourself) a favor. Go to the linked test page. Pick a color theme you like, change the language if you want and leave the other settings alone. Now do some reading and editing in the source code box. Don't worry about whether you like or dislike this particular font, Input Sans. I'm not much of a fan of it [1], but it will serve to make the point. Does the code look OK and editing it works OK? Now switch the font to Input Mono and take another look. Switch back and forth between Sans and Mono a few times to compare. (Skip Input Serif for this comparison as it's a rather different style of font. The cursor keys are handy here: click on Input Sans and then use the up arrow to go directly to Input Mono, and down arrow to go back to Input Sans.) To my eyes the code looks pretty similar in the Sans and Mono variants, how about you? But Input Sans is a proportional font, not monospaced! As stkdump noted, proportional fonts only break down if you use column alignment. Take this line in the Python code for example: vanillaView = ShowMouseCoordinatesTextBox((20, -30, -20, 22), "", alignment="left", sizeStyle="mini") If you want to get that down to 80 characters, you might do it like this in a column aligned style: vanillaView = ShowMouseCoordinatesTextBox((20, -30, -20, 22), "", alignment="left", sizeStyle="mini") The parameters will line up only if you're using a monospaced font. In a proportional font the last two parameters will appear to be shifted to the left. But you don't have to do it that way! This kind of column alignment has many disadvantages even in a monospaced font. (What if you rename the function or output variable?) Like stkdump, I would use indentation here: vanillaView = ShowMouseCoordinatesTextBox( (20, -30, -20, 22), "", alignment="left", sizeStyle="mini" ) Now you don't have to re-align if you change those names, and the code will be perfectly readable in any font, proportional or monospaced. Don't get me wrong, I'm not trying to persuade you to start using proportional fonts. I am hoping to persuade you and other developers to be more tolerant of those of us who like proportional fonts, and to avoid column aligned coding styles regardless of the font you prefer. Fair enough? [1] My favorite coding font right now is Trebuchet MS. It renders beautifully on high-DPI displays, much nicer to my eyes than Input Sans, and it has easy-to-distinguish glyphs for the common mixups like Il|. It does have a wimpy tilde, so I used a font editor to copy in a better tilde from another font.
- kodablah 8y agoLikewise, but I have just come to accept that although I don't care what font I code in (just disambiguate the look-alikes), lots of others do, in nauseating detail. So I just lurk on the conversations as I might on plenty of other nuanced tech fascinations that don't fascinate me.
- PhasmaFelis 8y agoWay too many stock monospace fonts make it hard to distinguish between lowercase ell, capital eye, numeral one, and pipe. All of those except pipe should have different serifs. (I feel like this is a problem even in proportional fonts, incidentally. I like sans-serif as much as the next guy, but if the word "Ill" looks like chicken-scratches then something is wrong.)
- kleiba 8y agoAnd yet, as I mentioned in my original post, I've been coding and using the shell etc. for decades and never ran into that problem in practice. I would bet that more production time has been wasted on a global scale with discussions about and fiddling with font options than with a wrong l, I, 1, | in a place where it shouldn't be.
- threatofrain 8y agoI see this as the weakest and most permissible of bikeshedding, especially because it happens in spare time as nobody would ever seriously distract a project with a debate about IDE font choice.
- rland 8y agoI call it Font Disease. Once afflicted, you will start noticing fonts, and for anything written you can control, you desperately want to find the best font possible--the default will not suffice. When you find a good font, it's very satisfying, and the action of you choosing that font is like scratching an itch. Sounds like you don't have Font Disease. Lucky.
- edoceo 8y agoOddly, I caught Font Disease around the time I also caught Old Age and my previously perfect vision became less perfect. The symptoms are: first fiddling with font size, suddenly 10pt was too small! Then I frobbed colour scheme for a bit, then boom, I'm downloading fonts. And trying others (eg: eval over a weekend project) and spending hard-money on font libs. By the time I realised I had it, twas too late! (Also, I'm using Hack, 16, Atom Dark)