-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LineLength: why 79? #1064
Comments
Although the style guide says "Limit lines to 80 characters." we check that each line is shorter than 80 characters, and it looks like it's one of my very early commits that made the change from 80 to 79. It's part of pull request #3 and I can't find that I discussed that particaular change at all so I guess now is a good time to do that. 😄 I've seen a 79 character limit in several style guides for various programming languages that I've used in my work. My guess is that it ultimately comes from 80 characters being a sort of de facto standard for old teletype terminals, and that this number was inherited into a lot of editors and other tools when graphical screens started to be common. The step down to 79 is for safety. Just in case there are tools that don't work well when the line uses the full width. The rightmost column could, for example, be needed for a symbol denoting line break, or for the cursor. In short; 79 should never be a problem, 80 might be. |
Ah, I see. I suppose at this point since our ruby code isn't likely to be run on teletypes it's a little arbitrary either way. PEP-8 also limits it to 79, though they call it a nominal 80. We'll stick to 79 since it means I get to just delete the rule from my |
I for one always have a local 80 columns is bad enough, even if historically defensible. 79, or anything less, is an S&M fetish. |
Ha, I guess I haven't found it to be that difficult one way or the other. We only had a handful of lines in our codebase that were right on the 80 character line anyway. It's nice to have so I can zoom once or twice while pairing and still keep vertical columns, and it tends to clarify the code, though we have had to come up with some new rules for how to wrap lines. |
I find that at the font size that my eyes can comfortably see (not too small, not too big), on a 27" Apple display, the line length for two side-by-side editor windows is well over 80 chars. Even my 13" MBA has a very comfortable line length greater than 80 chars. I think the 80 char default is an anachronism that should be replaced with something bigger. Of course, what that should be is a shed of a different color. For reference, we set it to 100 in all of our projects. |
@jonas054 I guess it makes sense to make it 80 by default to avoid further confusion. |
@bbatsov Right, we can't have this divide between the style guide and RuboCop. I should not have changed it to 79 without requesting the same change in the style guide. For me personally, 79 feels like the industry standard for line lenghts, but that's highly subjective. If you think that changing the default in RuboCop to 80 is the best way to restore harmony in the universe, then I support your decision. |
@jonas054 I'll change the default to 80 in the interest of achieving world piece and reducing user confusion. :-) |
Just to satisfy my curiosity, why is the LineLength default set to 79 instead of 80?
The text was updated successfully, but these errors were encountered: