-
Notifications
You must be signed in to change notification settings - Fork 30k
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
meta: Are the limits on line length still necessary? #14176
Comments
Refs (to compare with other popular guides): Airbnb |
Quick anecdotal query into GitHub |
I have found this more and more irritating in code. If your editor wraps then I'm not sure what the benefit is. I'd be +1 on increasing it to 100/120. For git I think it's different, the 50 char limit encourages people to be concise in the title, which is really helpful when you're doing a For the git body (and for I like the Airbnb style @vsemozhetbyt mentioned, ignoring strings and URLs (but not comments) makes sense: 'max-len': ['error', 100, 2, {
ignoreUrls: true,
ignoreComments: false,
ignoreRegExpLiterals: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
}], |
re: git, http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html I don't agree that we have more screen space now, because once the screen got wider, it became possible to put up two tabs side-by-side, which is what I do, and assume most people do, and both are 90 chars wide, as it happens, on my monitor, leaving room if I wanted it for some kindof tool tray to the side. IMO, most examples of long lines are either poorly written code, or because of long argument lists. With multi-arg functions and long descriptive names, there will always be wrapping, might as well wrap early (and hope people write functions with less args). Its also hard to follow lines longer than 70 or 80 chars visually, which is why newspapers format text into short columns. And diff tools do well with inter-line and not so well with inside-the-line text. Etc, etc. |
@AndreasMadsen (from #14173 (comment)), have you tried line wrapping? I often use a narrow editor, and I find the wrapping to be cleaner than what we do now: Not saying wrapping fixes all problems obviously, just a suggestion. |
I'd be +1 on extending the commit title to 72 columns, but prefer we keep the commit and code line lengths the same. I find that auto wrapping makes it more difficult to immediately see things the way sticking to a smaller line length does |
I prefer the limits the way they are now. |
I prefer the current limits as well. |
Agree with 120 columns per code line. |
I also prefer the current line length. Why, I feel 80 columns is already overly indulgent. When I was young we only had 72 columns and we were happy, we didn't know any better. |
|
The 50 / 72 rule has historic president and many tools are built around them I am -1 to changing our commit guidelines |
I'm +1 to leaving as it is. |
It's clear there is no consensus on making changes. I'll go ahead and close this out. |
I wanted to start a discussion on why we're still enforcing them? Is it possible to extend the limits?
Especially the 80 char per code line. There are style guides that extend the limit to 120 chars, or make an exception for function calls with many arguments, and string literals.
I'm assuming originally it came from narrow terminal windows, and that it's been kept popular under the assumption that one line of code should not do too much. But sometimes it leads to very cumbersome constructs:
a random example taken from
./configure
(that is actually a file that is not auto-linted.)while lines that do multiple operations are considered ok
Another example is documentation files, where we don't auto-lint so it's easy to find examples where it was not upheld. Also, AFAIK most editors can soft-wrap lines while files are anyway rendered to something prettier.
Ref: #8327
The text was updated successfully, but these errors were encountered: