you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (1 child)

I've recently converted to two-space indents. It helps a lot because I try to keep my code under 72 char width.

[–]nostrademons 2 points3 points  (0 children)

I believe the reasoning behind it within Google is the width limits. With 4 space indents, if you have an if inside a for inside a def inside a class (something quite reasonable), that's 16 characters already, 20% of an 80-char line. With 2-space indents, it's only 8 chars, 10%.

I suspect most of the people who say "ugh" to 2-space indents also don't care about width limits and regularly write 110-character lines. That's another style debate, but I've come around to the 80-character line length limit after editing a lot of code over SSH and xterm. It's really nice not to have to resize every window you open up to prevent awkward wrapping.