Live data from Hacker News

Almost monospaced: the perfect fonts for writing

blakewatson.com

141–150 of 174 posts

Re: Almost monospaced: the perfect fonts for writing

#141

Earlier quoted context omitted.

Writing programs by manipulating text is the actual limitation of the technology here, alignment is just a minor detail by comparison.

That's often heard, but what's the alternative? So far every other alternative has been more limiting, not?

AST, GUI... The technology is not there yet.

Re: Almost monospaced: the perfect fonts for writing

#142

See also: a little bit pregnant, almost alive, and close but no cigar. Yes, I read the article to the end. No, I don’t get it. Either they line up or they don’t. Either it’s monospace or it’s not.

Within the fonts that aren't monospace, some fonts have less variation in glyph width than others. It's a spectrum. You can choose a font that is mostly monospace, but not completely, to confer benefits for readability.

If all you're saying is that you personally don't care to make a finer distinction than monospace/proportional, that's fine, but it's probably not worth commenting on either.

Re: Almost monospaced: the perfect fonts for writing

#144

Isn't the whole point of monospaced fonts columnar alignment (e.g. the table in the article)? Seems like "almost" defeats the point. Then again, I don't see values lined up much these days: { "someKey": "someValue", "someOtherKey:" "someOtherValue, and if you only care about leading whitespace (that is, the whitespace before a character appears on the line), maybe it doesn't matter how your font is spaced. I suspect…

From the article:

> You might be thinking, “Okay, but now characters won’t line up neatly.”

Re: Almost monospaced: the perfect fonts for writing

#145
post #84

Earlier quoted context omitted.

The value of alignment (at least for me) is not in making the text of the code more readable. Instead, the value is communicating the structure of the code. Seeing the same shape repeatedly tells me a lot about what is happening. It also helps highlight changes between two lines that are very similar.

> the value is communicating the structure of the code. I agree and I think that is the same thing as code-readability. Code-readability means you can easily understand the code. I personally try to abide by what I call "hedge" formatting convention, the punctuation forms a vertical hedge which then shows the structure of your code clearly: [ a , b , c ] Moving my eyes down to look for the closing bracket is easier (…

Huh, I've always wondered about this style of code formatting and never fully understood why people did it.

Your explanation makes good sense. I guess I just wasn't seeing the forest for the trees. ;)

Re: Almost monospaced: the perfect fonts for writing

#146
post #86

> But there is a reason we don’t use monospaced fonts everywhere. They are somewhat hard to read because [...] Well, not sure what is the basis for that assertion, but I find it easier to read text rendered in a monospaced font (Courier is my favorite). In fact, when I need to read something longer than a minute on the browser, I switch to monospace (with help of a browser plugin). It's not about text alignment -- it…

Yeah, if everyone was used to reading monospaced fonts then proportional fonts would be hard to read. I suspect there might be a bit of an advantage for proportional in terms of ultimate reading speed in that you might be able to fit in an extra word in your scan, but the alignment of a fixed grid might help a bit too. The real value of proportional fonts is that you can print more stuff on the page and make your boo…

I have to disagree a bit. Even stipulating that there may be some economic drivers for more compact text, my observation is people largely switched to using proportional fonts (outside of some specialty cases like code or tabular data) as soon as it was technologically possible to do so. People generally preferred proportional fonts when it was practical to use them with the equipment reasonable at their disposal.

Re: Almost monospaced: the perfect fonts for writing

#147
It'd be interesting to have an eventually-consistent monospaced font that adjusts the widths of characters like `w` and `i` such that when they're within a few characters of eachother they become more proportional. Obviously adjacent characters can be done with ligatures so `wi` is still 2 char-widths wide, but aren't modern font-rendering systems smart enough to do more than ligatures with alternatives? I wonder what it'd feel like to watch these characters adjust width as you type.

Re: Almost monospaced: the perfect fonts for writing

#148

Earlier quoted context omitted.

Yeah, you’re right. You lose columnar alignment but beginning indentation still aligns and, in Input Sans, I believe the numbers are tabular. David Jonathan Ross makes this argument in the explainer for Input: > Sometimes programmers rely on the monospaced grid to create a second column of values or comments on the right side of the page. It’s true, these secondary columns won’t align in a proportionally spaced font.…

I still can't believe personalization isn't more widespread in coding. For instance, it ought to be reasonably trivial to set up your formatting preferences in your editor, but have the file saved to disk be in a common format. You want 8-space tabs and braces on their own lines? Cool. We'll save the file with all the formatting defaults, but run a formatter tuned to your preferences before displaying.

IMO, the fact that personalization isn't more widespread is good evidence that code style doesn't actually matter. Humans adapt. So long as it doesn't actually interfere with the function of writing code (eg mixed tabs & spaces; wildly inconsistent identifier names), your reader will get over it quickly after some snide comments to their friends on IRC, and then work on the actual work that needs doing. I think people spend too much thought on this topic.

Re: Almost monospaced: the perfect fonts for writing

#149
post #78

A while ago, while repurposing an old laptop into a distraction-free “typewriter” I researched fonts with a typewriter-like aesthetic. Here’s what I found: Sun Gallant Demi, Solarize, Libertine/Libertinus Mono, Triplicate, Prestige Elite, CMU Typewriter, Latin Modern Mono, MingLiU, sony-misc, Verily Serif Mono, Century Schoolbook Mono BT, UM Typewriter, American Typewriter, Courier, Pitch, TiredOfCourier, Xanh Mono,…

Another one you might like is TT2020: https://copypaste.wtf/TT2020/docs/moreinfo2.html This one aims to replicate the ink characteristics of typewriters; there are 9 versions of each glyph that get combined via Unicode rules to simulate the way typewriters would inconsistently distribute ink.

Re: Almost monospaced: the perfect fonts for writing

#150
post #61
post #32

Earlier quoted context omitted.

I long ago concluded that trying to line stuff up in columns like this in code is a mistake. It often results in realignment of blocks for small changes so what should be a small diff in the git history ends up being big. Only rarely is the vertical alignment useful because mostly code isn't read vertically. Used in moderation, the reverse Christmas tree style used in the Linux kernel can be as good for readability (…

This just seems like a limitation of the technology. When you change the width of one column, the whole table should realign, without any changes to those parts of the file (it's just about how it's displayed). I recall reading something about "tab stops" that solved this problem, but I don't think there are any mainstream implementations of it.

Tab stops are called out in the footnotes:

> Never attempt to line up text by using spaces. The only exception is if you are using a monospaced font. But in word processing applications, there are appropriate tools available for lining up text, like tables[1] and tab stops[2].

[1]: https://practicaltypography.com/tables.html [2]: https://practicaltypography.com/tabs-and-tab-stops.html

Post reply on HN