Re:Fundamentals of Optimal Code Style
by okareaman on Thursday March 25, 2021 @04:17PM
(#26584856)
Linus Torvalds disagrees about line lengths for what it's worth: https://news.ycombinator.com/item?id=23356607
[ Parent
| on HN ]
I find it difficult to have meaningful variable/function names and stay under 80 characters.
Plus, with code completion (especially in a strongly typed language) it’s no longer necessary to optimize for fewer keystrokes.
I do think having lines around 80 characters makes it more fluent to read code. It is not about saving keystrokes or to be able to do split screen even on smaller screens.
But what has worked better for me is to have it as a soft not a hard rule. Better to have some lines go over a bit than having awkward breaks that make it harder to read
The main problem is that code isn't like other text.
Strict rules are BS because they count characters that don't contribute to the actual content that you're parsing.
This includes punctuation and especially whitespace. I tend to keep lines short in general, too, but strict limits just for the sake of it are indeed more hinderance that helpful.
At one point he use to be fanatic about it. The VIM configuration line specific to linux kernel development originated from that insistance on 80 chars per line in the early days.
It made a lot more sense back then as well.
Re:Fundamentals of Optimal Code Style
by cryptonector on Thursday March 25, 2021 @09:49PM
(#26587977)
Count me in. I'm pretty tired of 80 (79) column limits.