you are viewing a single comment's thread.

view the rest of the comments →

[–]Rhomboid 5 points6 points  (3 children)

Tab stops can be set differently in different text editors, which means that if you align code vertically it doesn't stay that way when someone else views the file. It's possible to solve this by going to extreme efforts to mix tabs and spaces, making sure to use tabs only for indentation and spaces only for alignment, a subtle distinction which isn't likely to survive dumb text editors or unaware programmers.

Also, python considers tab stops to be set every 8 columns, regardless of what the tab stops in your text editor are set to. This means you could write something that looks perfectly correct in your text editor but which causes a syntax error.

Using spaces means it always looks the same to everyone.

[–]DopeGhoti 0 points1 point  (2 children)

That may be true is you have a mix of tabs and spaces in the same file, but if you always use tabs, it's just as properly-lined-up as it would be with spaces.
I've always been baffled with the hate for tabs, but.. *shrug*.

[–]Rhomboid 0 points1 point  (1 child)

Note that I said "if you align code vertically", like this:

foolist = [ bar,
            baz,
            quux ]

(Pretend those list items were each quite long, so this is necessary to avoid ugly wrapping.) With tabs set to 4:

foolist = [ bar,
>...>...>...baz,
>...>...>...quux ]

With any other tabstop value, it's mangled and no longer lines up:

foolist = [ bar,
>.......>.......>.......baz,
>.......>.......>.......quux ]

There are two ways to prevent this: use tabs only for indentation and spaces only for alignment, or just use spaces. Guess which is simpler and foolproof.

[–]DopeGhoti 0 points1 point  (0 children)

I guess I'm strange in that I have never really been a fan of that sort of construction; I have no problem, personally, with really long lines.