Maximum Line length and other styleguides #460
Replies: 2 comments 8 replies
-
Some reasoning for my choice of 100 (actually a little bit less, like 96 seems practical for me personally): I almost always have a split screen in my IDE (Emacs) with two panes side-by-side on a 16" laptop display. One is the file I work on, the other is usually Git status, search results, checker output list, or some other file used for API reference on the currently worked on code. I wouldn't like a hard limit pre-configured, but rather decide on a case-by-case basis when we encounter lines longer than the 100 characters. The vast majority of code lines will not even reach the limit of 80, if the code is well structured. If you ask long_function_being_called_with_many_args(foo_argument, bar_argument, baz_argument)
slightly_longer_beyond_the_limit(
foo_argument, bar_argument, baz_argument, frob_argument
)
really_long_line = long_function_being_called_with_many_args(
foo_argument,
bar_argument,
baz_argument,
) |
Beta Was this translation helpful? Give feedback.
-
With respect to recent development in Cpython: While working on the asyncio port of canopen I noticed that |
Beta Was this translation helpful? Give feedback.
-
Should we move away from the original 80 char limit per line?
Most of the industry already moved on, because there is no technical reason to force this char limit.
Linux Torvalds, Robert C. Martin (Uncle Bob) and Raymond Hettinger all support longer lines to improve readability.
Google, Facebook, etc. all moved away from 80 char limit.
Django as a big python project for example also uses 120 (119) char limit.
6 votes ·
Beta Was this translation helpful? Give feedback.
All reactions