Ask HN: Code etiquette - tabs or spaces?
what do you use?
what do you use?
If you find that your code doesn't fit into 78 columns using 8-character tabs... you need to refactor your code.
If your editor mangles whitespace... get a better editor.
It depends a lot on the style of code... some apis will have really long names and require a lot of arguments. In this case you'll run over 80 columns even if you use two-space indentation (which we do at my workplace).
But if you're so anal about whitespace, there's always regex...
'Spaces instead of tabs' wasn't the near the near-religious fervour of which editor to use though (VSlick won at my 1st company - e.g. company bought group license - though you could buy your own fave). I guess if you spend all day working with a hammer, you want the best hammer for you. I've spent hundreds of my own to buy my own editor to use at work.
Indentation
Use 4 spaces per indentation level.
(see http://www.python.org/dev/peps/pep-0008/)I'm partial to spaces in general. Most (all?) IDEs can insert spaces when you press the tab key, and doing so will prevent the nastiness that can happen when you mix spaces with tabs.