limit docstrings and comments to 79 characters #207
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This project has followed the following convention from the start:
Enforce this by adding the rule W505 for ruff.
Thoughts
Although the exact numbers (79 and 88) could also be something else
and still offer a good developer (and code reading) experience, those
numbers are pretty close to optimal. The reason for this is that I,
among many others develop on small screen (laptop). I also use a large
font / small resolution (which makes font larger) to make it easier for
my eyes. As it's pretty common to need to have code side by side, the
roughly 88 characters starts to be absolute maximum so one does not need
to do horizontal scrolling.
There must be some reason people like to have shorter docstrings than
the actual code.
Could perhaps some day use same line length for code and comments, but
even with the 79 char limit the experience has been quite good and the
code looks easy to read in my opinion.
Refs:
https://peps.python.org/pep-0008/
https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/coding-style