Hacker News new | ask | show | jobs
by kibwen 583 days ago
Note that when we talk about line length limits, we're actually conflating two separate concepts:

1) The maximum width of our viewports

2) How long we want our lines to be

WRT the second concept, the general rule of typography is that a line should be 60-80 characters long. But, crucially, this is not counting indentation; a "line" here begins at the start of the text, not at the start of the margin.

In the modern day we could decouple these two concepts. Imagine a standard code format that assumed a maximum viewport of, say, 120 characters, but still wrapped lines when they reached 80 characters in length, not counting indentation. Then you could get the benefits of both enforcing a maximum viewport size while having a comfortable line length for reading.

1 comments

Is there a single formatter capable enough for this?
Any formatter that already wraps on line length is capable enough for this, it's just a matter of taking the existing line length check and adding a single new conditional.