To view parent comment, click here.
To read all comments associated with this story, please click here.
Limiting code to 80 columns in this day and age is just ridiculous. There's nobody out there still programming at the console (an 80x25 console at least), and everybody else just uses more than 80 columns with no problems.
You may say long lines make code more difficult to read, but if you limit yourself to lines with at most 80 characters (excluding leading whitespace), you won't that that big of a need to break statements into multiple lines.
But forgetting that, most statements that can become longish can also be broken in multiple lines without backslashes (argument lists, conditional statements, ...). Every statement that requires something more can have that something more on another line without using backslashes.
Actually right now I can't see anything that can't be broken, other than strings... (eg: print "some" \ "string")
You would actually be surprised just how many people are still doing this. I'm surrounded by them. And, yeah, I think it's borderline ridiculous.







Member since:
2006-03-23
Except that if you want to keep your code width limited to, say, 80 columns, then in many cases you are forced to use backslashes at the end of a line to inform python that you intend to continue it in the next. I personally prefer braces or "end" keywords over having to do this manual dance, which sometimes makes me feel I'm writing for the C preprocessor.
Example:
$ cd /usr/share/blender/scripts && grep '\\$' *.py | wc -l
938
Edited 2008-10-10 09:02 UTC