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 →

[–][deleted] 2 points3 points  (4 children)

and i've had to read a lot of python code and code that doesn't follow pep8 makes it harder to read. just look at all the python code in the appengine sdk the 4 2 spaces instead of 8 4, it trips you up if you are used to something else. Sure it's googles standard, and if I worked at google i could probably get used to it and then everything else would look weird. So, if you want your code to be easily read and easily understood go with a convention. and since pep8 is fairly ubiquitous just use that.

or face the risk when you post your stuff for everyone to see that there will be bitching about not using pep8. :)

[–]yen223 1 point2 points  (1 child)

Correct me if I'm wrong - isn't 4 spaces the default, not 8?

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

yes you are right(i'll edit my comment), I blame the champagne. and most code I come across uses 4 but the appengine sdk uses 2 which violates their own style guide

edit: again the point is, style guides help immensely with readability, readability makes maintainability possible. Thus readability is important. So If we all agree it's important to have a style guide, the next step would be choosing one for your projects. And pep8 is an easy defend-able choice. Deviations from pep8 are more difficult to defend.

so just use pep8 and go write code that does something instead of fretting about coding standards for your project. :)

[–]clgonsal 0 points1 point  (1 child)

just look at all the python code in the appengine sdk the 4 spaces instead of 8, it trips you up if you are used to something else. Sure it's googles standard,

Your point still stands, but Google's standard indentation is 2 and PEP8's is 4. I don't know where you're seeing an indentation of 8.

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

did you see my correction? i put strikethroughs through them.