7 ms·
I decided to try using proportional fonts for coding starting a year or two back. It worked out well and I stuck with it, because proportional text is easier fo
by ben_pfaff 6mo ago
I decided to try using proportional fonts for coding starting a year or two back. It worked out well and I stuck with it, because proportional text is easier for me to read on the whole, and because it allowed more characters to fit comfortably on each line on average. I did find after a while that occasionally the lack of alignment between characters on two subsequent lines was a problem, but then I configured my editor so that it showed comments and text strings in a monospace font and that fixed the problem for me.
- deafpolygon 6mo agoI want to use proportional fonts, but the terminal fonts don’t support those font grids well.
- CharlesW 6mo agoThis seems a great solution, and I'll definitely be trying it. I feel like monospace fonts are the Roman roads → horse ruts → rail gauge of our industry.
- asibahi 6mo agoI am curious, which editors allow different typefaces for different code elements? (XCode, I think, but what else?)
- bgrainger 6mo agoI first encountered this in Bjarne Stroustrup's 2000 book, _The C++ Programming Language_. As he notes in the introductory material: > In code examples, a proportional-width font is used for identifiers. … At first glance, this presentation style will seem “unnatural” to programmers accustomed to seeing code in constant-width fonts. However, proportional-width fonts are generally regarded as better than constant-width fonts for presentation of text. Using a proportional-width font also allows me to present code with fewer illogical line breaks. I switched years ago and would never go back to monospace.
- efortis 6mo agoI edited a proportional for coding, I’ve been using it for 10 years and it’s great except for tabular alignment. So it would be nice if IDEs rich-rendered regions column aligned. eg, object literals in JS, in which space separator are as a wide as needed to align the values. JetBrains MPS has a decision table rendering for DSLs, which is similar to what I described.
- noisem4ker 6mo ago> tabular alignment Check out "elastic tabstops": https://nick-gravgaard.com/elastic-tabstops/ https://nick-gravgaard.com/elastic-tabstops/
- efortis 6mo agoAre you Nick?
- noisem4ker 6mo agoNo.
- efortis 6mo agoThank you anyway, that gave me an idea for implementing it. Here's the prototype https://x.com/efortis/status/2039539455128686677 https://x.com/efortis/status/2039539455128686677