@minekpo1 @dotjayne The only option other readers can have influence on the indentation in terms of visual representation without modifying the file.
Why should another person force someone to a specific visual representation of the indent width? That should be a sole decision of the one currently viewing the code.
@dotjayne I prefer 80 characters because even on a "modern" full-HD monitor, once I adjust the font size to make reading comfortable… 80 characters winds up being a practical limit because I often view two files side-by-side on the same monitor.
That said, it's a guide and not gospel, break the rule if there's a good reason to do it.
It's like indentation… e.g. Python is space-indented normally because text editors had shocking tab compatbility back in the day… but for example NVDA (a screen reader) uses tabs even in Python code, because it's easier to count 3 tabs than 12 spaces.
@dotjayne Yeah I'm a 78-character person except when I'm a 120-character person.
or 78-character character perhaps
And I do enjoy the discipline that is forced upon me when at least *trying* to keep the commit message first line within 60 characters.
@ctrl @dotjayne Yeah, 80 characters can be pretty good for fitting on half the screen... for some screen sizes and fonts.
Really it might make more sense to automatically reflow for viewing. In some ways its quite odd that `man` will happily reflow formatted text for the size of terminal I'm using, but for source code we expect a certain width baked into the file.
Text files formatted for a specific width are pretty archaic and uncommon at this point.
@Canageek @dotjayne I looked it up on snopes and it's not intentional but it traces back connections of "because of this, than that, because of that than more..."
Not direct now intentional but a series of happenstances that you can trace the link
Correct me if they're wrong because I thought it was an urban myth as well
@raktheundead @YimbyEarth @Canageek @dotjayne
The Snopes article does mention multiple gauges but talks about why the current most common gauge became predominate
@dotjayne I find a maximum of ~120 characters is the sweet spot for readability - if the lines are much longer I lose track of where I am.
Unless the code is so deeply indented the entire block is shifted over more than 120 characters... In which case I'd probably look to refactor
if expressions@dotjayne Back in the 90s, I was told a cautionary tale that went something like this, though I've forgotten the specifics:
A mining company had three mines that they had been operating for years. A decision was made to close down one of them, leaving the panicked programmers to figure out which of the hard-coded 3s in their code referred to the number of mines.
Moral: If a whopping big hole in the ground can just go away overnight, the width of a monitor can change too. Define your constants.
@dotjayne Disagree, on a technical level this might be true.
Excessive line lengths are an anti-pattern and might be a hint that there are design problems with your code: too deeply nested and/or too big methods.
Long lines are hard to read and a cognitive burden. There are reasons the ancient terminals were designed the way they are and printed text / books also limit their width to a certain size that's easy to scan for the eyes.
(It's hard to follow/fibd lines when things get too long)
I've just watched this video... https://youtu.be/zrq2_koM1zg 😂
(now I'm going to look if the author bothered to link sources because while it's more plausible than horses' butts story, I don't know authors credibility yet...)
main source, looks real: https://garethdennis.medium.com/the-not-so-glamourous-origins-of-standard-track-gauge-2b5f1ae7e3bc , including the difference between track gauge and loading gauge. 🙂