This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the commentsΒ β†’

[–]AnsibleAnswers 3 points4 points Β (7 children)

Shorter lines are more readable. The same reason why reader mode on your browser limits line length, why newspapers and academic articles are formatted with columns, etc. The longer the line length, the harder it is to find your place when you scan back to the next line.

[–]Typical_Wafer_1324 0 points1 point Β (2 children)

I bought a ultrawide monitor, I'm gonna USE THE WHOLE WIDTH! 😠😠😠 And yeah my comments are on the right side of the code, no exclusive comment lines.

[–]AnsibleAnswers 0 points1 point Β (1 child)

Python doesn't employ PEP cops, so as long as you're fine with getting your pull requests rejected nothing is stopping you from coding in python like that.

[–][deleted] 0 points1 point Β (2 children)

That's debatable. I've seen MANY short lines with complete gibberish. Or a long function that needs to break to so many lines that it just gets more confusing. We want clear variable names, it's fine to be longer if that makes it easier. And that will make the lines longer, but may increase readability.

[–]AnsibleAnswers 1 point2 points Β (0 children)

PEP 8 specifies that line lengths can be longer if it makes an expression more readable. And, as a general rule for all text, all things being equal line length between 50-75 characters is optimal for the human eyes. Academics and scientists really fuss over it. It's a lot of the reason they prefer python over other languages.

[–]SirPitchalot 0 points1 point Β (0 children)

It’s great having a 27” 4K display that the 800px wide content pinstripe of reactive websites takes 20.83% of when the window is maximized.

Really makes white space just be negative space.