News for hackers. Stuff that matters.
Re:Google's Python style guide by jdevera on Thursday April 19, 2012 @07:03AM (#3862339)
Why oh why the 80 character limit? It's the 21st century, screens are huge! I'm not saying let's put the limit in 300, but 100 or 120 is good enough to fit side by side diffs in one screen.
Re:Google's Python style guide by raverbashing on Thursday April 19, 2012 @07:20AM (#3862387)
There are 2 issues there

1 - yes, screens are huge, but it doesn't mean people can/will use small fonts or will scroll the screen

With today's big/wide screens it's more useful to have code side by side.

2 - Abuse. The 80 character limit is a pretty good indicator that you should be doing something else instead of having your code go over 80 characters.

Long lines are confusing, and you most likely can split the logic in several lines, facilitating maintenance.

Re:Google's Python style guide by jdevera on Thursday April 19, 2012 @07:32AM (#3862421)
I see both points but regarding (2), there are common cases where you are not necessarily doing anything wrong but the 80 character limit will make your code less readable, especially when using four spaces or more for indentation. For example you might end up in the fourth level of indentation wanting to write a list comprehension that would be perfectly readable in one line but have to break it down because of this rather short hard limit.

I think having a soft and a hard limit makes more sense, if anything, I would make 80 characters the soft limit and perhaps 100 a hard limit, although I'd prefer them to be 100 and 120.

Re:Google's Python style guide by bonzoesc on Thursday April 19, 2012 @07:34AM (#3862426)
If you're in the fourth level of indentation, you might already have a readability problem.
Re:Google's Python style guide by jdevera on Thursday April 19, 2012 @07:56AM (#3862489)
"Might" being the key word. You might, if you are writing a simple script, but if you are writing some more complex code, class and method already take two levels, and that is your base line, I don't see how having two more levels is a readability problem.
Re:Google's Python style guide by khill on Thursday April 19, 2012 @10:53AM (#3863278)
I find that limiting line length to 80 characters causes some programmers to use overly terse variable names. This hurts code readability and can hide defects.
Re:Google's Python style guide by arethuza on Thursday April 19, 2012 @08:20AM (#3862571)
I've recently started developing in Python (after developing in many other languages) and I thought I would find the 80-character limit from PEP 8 a problem.

However, I've actually found it to be a good thing - I'm sure it aids readability.

Re:Google's Python style guide by pbreit on Thursday April 19, 2012 @10:24AM (#3863116)
Because it's easier for a human to read. It has nothing to do with prevailing screen sizes.
Re:Google's Python style guide by jdevera on Thursday April 19, 2012 @12:27PM (#3863780)
My point is that having 80 characters as a hard limit sometimes imposes some linebreaks that negatively affect readability. My mention of the screen sizes comes from the fact that the 80 character limit originally was set to fit the code in a 80x24 character terminal without non-explicit line wraps.
Re:Google's Python style guide by Locke1689 on Thursday April 19, 2012 @11:14PM (#3866352)
Depending slightly on your font size, 3 80-column lines fit side-by-side almost perfectly on a 30" monitor.