How big is a screen? Try 60 lines by 140 characters; that's roughly the maximum that's comfortable for a book page.
Would it be possible to change the upper limit to no longer than 110? 140 characters long lines are difficult to read. No wonder, I haven't seen any book with 140 character lines.
(If you bring side-by-side diffability in the picture, then 80 characters would probably be a better limit.)
60 x 140 is just an arbitrary number. If some of the code I've seen would limit itself to just 140 chars per line, it would make it much easier for me to read.
The guideline is just trying to suggest an opinion to people who don't have one, or gently suggest a better alternative to those who act out of habit without a reason.
You sound like you have a reason to prefer what you do. For myself, a 132 char limit is best for side-by-side, but the font I use is tiny.
I guess that typographically speaking, the number of characters in a line
should be between 45-90 (https://practicaltypography.com/line-length.html).
Concerning the code, industrial standard for readeability changes from 80
to 120 characters in a line to accomodate larger screen available today.
Michele
2018-06-01 11:28 GMT+02:00 Shalom Craimer notifications@github.com:
60 x 140 is just an arbitrary number. If some of the code I've seen would
limit itself to just 140 chars per line, it would make it much easier
for me to read.The guideline is just trying to suggest an opinion to people who don't
have one, or gently suggest a better alternative to those who act out of
habit without a reason.You sound like you have a reason to prefer what you do. For myself, a 132
char limit is best for side-by-side, but the font I use is tiny.—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/isocpp/CppCoreGuidelines/issues/1224#issuecomment-393825761,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AYnAYKJfqnCBK6ElxNCXF-56LuHdOOQhks5t4Qk3gaJpZM4UWStt
.
If you add the whitespace trom a few level of identations to the typographical recommendation of 45-90 you are still under 110. That's why I'd recommend that size.
IMO larger screen sizes don't increase the visible line size that much, as some people (most of my current co-workers) tend to switch to portrait (rotating the screen by 90%). This way I cannot comfortably do side-by-side diff on lines longer than 83 characters.
I don't think this is the place to argue about a specific number. The point of this guideline is that there should be a number. This guideline is supposed to advise against people doing silly things like writing lines that are super long.
Actually this guideline is about function length. Perhaps discussion about line length should be broken into its own guideline if it doesn't already exist.
140 is intended as an absolute upper limit for whatever one group might choose to do.
If it matters I worked groups that have chosen these lengths and put them in their own style guides: 72, 80, 120
I think a working group's style guide is the right place for a specific number. Whether that working group codes for an open source project, at a company, or a lone hacker in his basement. They each have different needs and expectations and no number we could put here would make them all happy. We also shouldn't pick a specific number because it will be a source of bikeshedding. So let's just suggest teams or programmers pick a number.
Fair enough. Then would it be possible to replace the actual numbers with something like "pick a number for your project that fits your infrastructure (common monitor sizes, orientation, diffing tools, etc)"?
I'd rather avoid the situation when somebody tells me that 140 character lines are OK, because he read it in the guideline.
Maybe it shouldn't be in the Enforcement section, but just a suggestion like everything in https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#S-naming
We agree, and both of the F.3 Enforcements were intended to be suggestions that a house rule set choose some limit, we should make it clearer that these are not intended to be actual Enforcements for all programmers everywhere.
Most helpful comment
Maybe it shouldn't be in the Enforcement section, but just a suggestion like everything in https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#S-naming