3 ms·
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 jdevera 14y ago
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.
- raverbashing 14y agoThere 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.
- khill 14y agoI 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.
- jdevera 14y agoI 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.
- bonzoesc 14y agoIf you're in the fourth level of indentation, you might already have a readability problem.
- jdevera 14y ago"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.
- arethuza 14y agoI'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.
- pbreit 14y agoBecause it's easier for a human to read. It has nothing to do with prevailing screen sizes.
- jdevera 14y agoMy 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.
- Locke1689 14y agoDepending slightly on your font size, 3 80-column lines fit side-by-side almost perfectly on a 30" monitor.