Python Forum
"Limit all lines to a maximum of 79 characters"
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"Limit all lines to a maximum of 79 characters"
#11
I also do around 108 but that is because my monitor is usually split with two windows (one to the left and one to the right) and 108 characters are about to where that width is. 80 is just too short.
Recommended Tutorials:
Reply
#12
(Jun-19-2019, 06:21 PM)Skaperen Wrote: how did you happen to pick the number 108?

801 seemed too long. Besides, 108 is way cool, being a hyperfactorial (1 ** 1 * 2 ** 2 * 3 ** 3), and having all sorts of other mathematical and religious properties.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#13
so why not 144? that is very hyperfactorial. or will it not fit your display?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#14
144 is not a hyperfactorial. The next hyperfactorial after 108 is 27,648.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#15
90'ish Beyond PEP 8.
Black use defaults to 88 characters.
I feel like 90'ish is okay for almost all i do,in very rare cases over 100 if it make no sense to split it up.

Also some wise advice in Black:
Black Wrote:You can also increase it, but remember that people with sight disabilities find it harder to work with line lengths exceeding 100 characters.
It also adversely affects side-by-side diff review on typical screen resolutions.
Long lines also make it harder to present code neatly in documentation or talk slides
Reply
#16
(Jun-20-2019, 11:04 AM)snippsat Wrote: Long lines also make it harder to present code neatly in documentation or talk slides

I would note one exception to my 108 character limit. My docstrings are 79 characters long, excluding preceding white space. That's to keep it intelligible if you type help(whatever) in a terminal window.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#17
i have a very wide edit window (172) but rarely go past halfway across. often it is just a comment. but it's a comment that begins within 3 characters of the end of the code on that line, so it's not hard to see which comment goes with which code. i do prefer to have comments on a line above the code but sometimes it just comes out better on the same line. even more rare is the code stretching way past the center, but it can happen. often i break up some long code into many lines such as print() calls with many arguments, one argument per line.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020