Consider increasing the advised maximum column count #331
Replies: 2 comments
-
We are using black, and this is black's policy about line length:
https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html#line-length This all sounds very reasonable to me, and if we are using black, I would prefer to stick with black's defaults as much as possible. It seems like most sources advice against going beyond 100 characters, so we are talking about an extra 12. I don't think that justifies diverging from the default. Also, one of the main reasons to use black is to avoid these styling discussions, as if we change it 110, tomorrow there will be someone else asking to either increase it to 120 or to get it back to 88. If there is no clear rule that will make everyone happy, again, I would just stick to the default and keep the dictatorial spirit of the tool of ending trivial styling discussions by saying no, sorry we do it this way :D. |
Beta Was this translation helpful? Give feedback.
-
We had no more complains about this, so I'm closing this discussion. |
Beta Was this translation helpful? Give feedback.
-
What's needed?
The currently advised column count is 88 (as per pyproject.toml). This looks like an already increased value from the good old 80x25 times (fun fact, back then we used to have a max column count of 78, because left and right margin columns where potentially used for ASCII line drawing, like editor border).
In today's world, 202x, most users have HD to UHD screens and a much higher terminal/editor width-and-height configuration, way beyond 80x25.
This value should certainly not go total mayhem, because a good maximum column count per coding line should still be conveniently be caught by the developer's eyes (excluding myself here).
Proposed solution
My proposition is to advise a character/column limit of 110. This value is a pure suggestion out of personal experience. I only rarely exceed the limit in cases were breaking it up would reduce readability.
This is more a decision process ticket with a tiny change to the project configuration. Future PRs might take advantage of this. :)
Use cases
Code is not always more readable if it's forcefully broken up into multiple lines. Sometimes it makes sense to have longer lines. Since the today's screen space is more than fitting, we should use it.
Alternatives and workarounds
No response
Additional context
NB: 3 years ago (2022), the Linux kernel coding guidelines also moved up from 80 to 100.
Beta Was this translation helpful? Give feedback.
All reactions