Live data from Hacker News

But no, 80-column terminals in 2020 isn't “reasonable” any more

lkml.org

91–100 of 330 posts

Re: But no, 80-column terminals in 2020 isn't “reasonable” any more

#92
I long ago concluded that arguments over line width, indentation, etc. are a waste of time. If I were submitting a kernel patch, I'd follow the Linux standard without complaint, regardless of my preferences.

That said, the best argument on line length is “the magic number 7, plus or minus 2”, our limits on short term memory. I like to be able to comprehend a line of code (or of text) in one glance, which seems to me to be about 65 characters, ignoring leading indentation; that might well be less than about 10 tokens. With wide tabs, that might well hit something around 90 characters, perhaps.

IMHO, it's not the line length that matters, but the number of tokens per line.

By the way, I like to work on laptops. If anyone knows where I can get a laptop with a 43" screen, please let me know.

Re: But no, 80-column terminals in 2020 isn't “reasonable” any more

#93
post #6

Many programmers are averse to line wrapping plain text files (especially source code), which has never made much sense to me. There's great support for it in like every editor.

I've recently been getting used to using line wrapping in VSCode (Alt+Z) and it's been working great. I only wish it was a bit more "semantic", similar to running a linter with a specified width rather than just copying the indentation of the previous line, so that e.g. when I need to wrap a line that's a comma separated list (e.g. function parameters) it lines up the list elements in 1 column:

    def f(
        a,
        b,
        c,
        d
    ):

Re: But no, 80-column terminals in 2020 isn't “reasonable” any more

#94
post #68
post #49

The problem with overly wide lines is that it hurts readability because it's harder to find the next line when scanning your eyes from right back to left. Take it from the world of books: This study may be helpful: > This study examined the effects of line length on reading performance. Reading rates were found to be fastest at 95 cpl. Readers reported either liking or disliking the extreme line lengths (35 cpl, 95 c…

Let's say I want to find every function call too `foo` that passes `true` as the last argument. I might do something like `grep "foo\(.*true\);"` That would work well enough if the codebase was mostly uniform and all calls to foo were on a single line. However, if we have callsites like "foo(x->y(get_arg(z)), something, \ntrue);" where 'true' is split onto a newline, that naive grep misses it. As linus says, grep is…

> where 'true' is split onto a newline, that naive grep misses it.

This misses the point, same as Linus (which i honestly find surprising)... 80 width lines is a target to try to achieve _naturally_, if someone is splitting code by inserting unnatural breaks then they are trying too hard, OR there could be various other legitimate reasons like very long function names and naturally verbose PL syntax that make even longer line widths unreasonable. Regardless of width constraints many people will split the arguments of extremely long function signatures onto multiple lines out of preference anyway, then grep will still get stuck without more caring regex.

These arguments always emerge out of someone misinterpreting guides as absolutes. No one is arguing we need to stick to 80 column terminals otherwise everyone would autowrap their commits and we'd have horribly unreadable breaks everywhere. 80 is historical, but trying to keep code width short does improve legibility, 80 just turned out to be a pretty good human standard as well.

Re: But no, 80-column terminals in 2020 isn't “reasonable” any more

#95
Damn this sure is not what I expected Linus to be saying, I seem to remember a previous lengthy, swear-filled rant from him about why the Linux sources require a line break at 80 characters and why this is absolutely perfect and sensible and will never ever change and you are a moron for suggesting otherwise?

I may be imaging this, I dunno.

Re: But no, 80-column terminals in 2020 isn't “reasonable” any more

#96
Optimal code line width has very little to do with monitor or window width. It's more of an anatomical restriction: the resolution of the human eye and the field of view.

For example, if we had 10 meter-wide monitors we won't be able to see them entirely from a close distance. Increasing the distance will require to increase the font, so the number of characters per line we can use doesn't change much.

Not so long ago I showed a piece of code on a mobile phone to a colleague, saying he should use shorter lines. He replied I need a larger display. When I opened the same code on my desktop display the lines were not fitting the editor window almost the same as on the mobile screen. (The angular sizes of a mobile phone screen and individual characters on it are approximately the same as of the bigger screen and characters on it because we keep phone closer to eyes).

I currently work with a codebase where long lines are used and it is so inconvenient. When I switch to some 80-cols code it is such a relief.

Re: But no, 80-column terminals in 2020 isn't “reasonable” any more

#98
post #49

The problem with overly wide lines is that it hurts readability because it's harder to find the next line when scanning your eyes from right back to left. Take it from the world of books: This study may be helpful: > This study examined the effects of line length on reading performance. Reading rates were found to be fastest at 95 cpl. Readers reported either liking or disliking the extreme line lengths (35 cpl, 95 c…

It really doesn’t matter.

We must strive to separate content and presentation, so people could choose whatever presentation they like (and have the editor do the wrapping as desired), for whatever whimsical reason that is nobody else’s business. It’s crazy to keep having this discussion and debating what the “research” indicates.

C’mon, haven’t we made any progress in forty years!? Everybody can have their own damn bikeshed, and paint it a different color every day.

Personally, I like to see more things happening in one screenful, so artificially imposed line breaks are really really annoying and break momentum when reading/scanning code.

Post reply on HN