4 ms·
Isn’t there some merit to the notion that long lines are typically either overly verbose or mentally challenging to understand?
by alex_young 6y ago
Isn’t there some merit to the notion that long lines are typically either overly verbose or mentally challenging to understand?
- kstrauser 6y agoIn APL, sure (at least for me). In most common languages today, using meaningful variable names, it's pretty easy to have wide but readable lines.
- colechristensen 6y agoSplitting one line into many because of character limits can also make an action overly verbose or mentally challenging. In some cases, unreasonable gymnastics needs to be done to get 80 character lines, turning good variable and function names into shorter worse ones or adding functions just to hide characters.
- Normal_gaussian 6y agomost languages support simply adding "visual" newlines in the middle of a "logical" line; I tend to do this to improve readability - could this be done to avoid your long lines?
- colechristensen 6y agoSometimes, but not always. I often do it too to improve readability, but it doesn't always actually improve readability. Sometimes it takes something which makes logical sense to have in one line and arbitrarily breaks it up in awkward spots over several lines. If you squish code into 80 characters wide, you lose vertical density, making a set of actions more difficult to understand by separating steps.
- isoskeles 6y agoI think so, but it's still inconvenient when a length limit applies to something reasonable. Applying a short limit to solve the problem of any single line becoming overly-complex will have other consequences. Most obviously, it's going to push some developers into bad habits re: naming things, where variable names that have more meaning than a counter become single letters.
- microtherion 6y agoSubjectively, I feel that at some width, I lose the ability to take in lines at a single glance, and spend more time in horizontal head movement. I rarely test this in code, but in web pages that use the entire width of the window, it's pretty evident to me that my reading speed goes down when the text gets too wide. Like Linus, I find 80 columns too narrow a limitation (and I got started on a 40x25 system, not even 80x25), but it would seem useful to me to standardize on some sensible maximum width, e.g. 100 or 120 columns.
- eeh 6y agoI think there's some merit to this, but it's a bit strict. Suppose I'm at 80 characters, and everyone agrees this is a reasonable line. Then suppose I refactor a variable that was 3 characters and its now 12 characters, and everyone agrees this is a better variable name. Now my 80 character line is 89, and it's suddenly unreadable? No, that's still readable, it's just longer. Personally if I see a long line, I try to shorten it, but I'm okay to leave it long if I think longer is better.