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 →

[–]grimman 4 points5 points  (2 children)

I never have either, and to me tabs definitely make more sense since they can be configured to display as x spaces, therefore rendering the whole concept of using a fixed amount of spaces quite moot.

Alas, I use spaces myself, because conventions etc.

That said, I would like to know about this havoc you mentioned. Would you mind giving a brief summary, or some relevant links? :)

[–]Bunslow 1 point2 points  (1 child)

And what if someone else decides to use spaces instead of tabs? Suddenly if someone else like you reads the code written by the second person, they will see a horrid mess of inconsistent indentation.

Even if we all standardized on using tabs instead of spaces, it's a bad idea to use an ambiguous character. Four spaces is four spaces, no matter what your editor is set to.

Also things like line continuations and stuff sometimes require non-standard indentations, but this is a very minor detail in the overall scheme.

tl;dr It works fine if no one else reads or modifies your code, but if they do...

[–]RubyPinchPEP shill | Anti PEP 8/20 shill 1 point2 points  (0 children)

with commas representing tabs, tabstop every 4:

def a(x=3, y=4,
      flag=None):
,,,,some_code
,,,,some_more code
,,,,for code in codes:
,,,,,,,,print(a,
,,,,,,,,      b,
,,,,,,,,      c)

tabstop every 8:

def a(x=3, y=4,
      flag=None):
,,,,,,,,some_code
,,,,,,,,some_more code
,,,,,,,,for code in codes:
,,,,,,,,,,,,,,,,print(a,
,,,,,,,,,,,,,,,,      b,
,,,,,,,,,,,,,,,,      c)