if you watch silicon valley HBO then you’d know the tab vs spaces arguments that took place there. it is said that tab save you 4 spaces and give your code smaller sizes. while you may agree with this, you should know that when you code in python it is very important to have indentation in your code or else the interpreter would throw a syntax error.
I also prefer tabs because:
- They’re a character specifically meant for indentation
- They allow developers with different preferences in indentation size to change how it’s the code looks without changing the code (separation of data and presentation)
- It’s impossible to half-indent something with tabs. So when you copy code from some website that used 3 spaces into your 4-space indented file, you don’t have to deal with misalignment
Use spaces if you’re lining up characters within a line, so they always line up regardless of tab size.