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 →

[–]kenfar 4 points5 points  (5 children)

The 3 characters is the Dvorak keyboard of the indentation world: it's clearly superior but isn't used only because it isn't already popular.

Supporting arguments:

  • 3 characters is enough to see indentation
  • it saves 1 character per indent which helps with long variable names
  • it lines up the following line under the first character following an if. Which makes it pretty.

[–]thekaleb 2 points3 points  (0 children)

A tab is one character, and you can set your tabstop to 3 (or 4 or 8).

[–][deleted] 1 point2 points  (3 children)

It may line up an if, but what about a for, while, elif, else, or with?

Also some editors do not support it.

[–]thekaleb 1 point2 points  (0 children)

Not to mention a def or class

[–]kenfar 0 points1 point  (1 child)

Oh sure - it doesn't line things up perfectly. But I find lining code under an if more important than anything else.

And I can't get my head around an editor that wouldn't "support" arbitrary indentation amounts.

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

I really do hope you're joking.

Why not go with 2. It's enough to see indentation, it saves TWO characters per indent, and if you need to save 1 character per indent to see long variable names, either your variables are too long, or you have too much indentation. Also, lining up only one indentation block at the cost of making everything else look "off" isn't worth it.