This thread was on reddit about a month or so ago, but I didn't stumble on it until just recently. Basically, the thread talks about the dreaded tab character, and it's effect on Python code using different editors. I have pasted the items I find most interesting.
It's amazing the philosophy changes that one can have when stumbling upon something of this nature. Moral of the story? Don't use the tab character when editing Python code. Have your editor fill the tab with spaces to keep everything uniform.
You know, the more I see the debate about spaces and tabs, the more puzzled I become that anyone still wants to use tabs. They *only* work nicely, IME, when a source file has only one author making changes, with only one editor. Give the file to another author (who uses a different editor) and boom! Nasty stuff happens, about 80-85% of the time.
... (snip) ...
I cringe every time I see a tab character in source code that I have to edit, because I know indentation issues are going to be ugly. I have to guess what tabstop settings the original author used so that I can exactly mimic his view of the code, otherwise my own additions will look fine on my screen but ugly on his. And nobody ever seems to document what tabstop settings they use! A simple comment in the header of the file would make a lot of difference...
... (snip) ...
I don't like tab characters. I wish they would go away and that everyone would stop using them. They cause me far too many headaches, and I have never found a good use for them. Every time I have to edit a source file with tabs, I have to explicitly think about indentation levels...
... (snip) ...
Lest anyone get me wrong, I am in no way opposed to using the Tab *key* on your keyboard to indent lines. That's a great use for it. My Vim has the "expandtab", "smarttab", and "autoindent" options turned on, which
makes my Tab key practically into a Do-What-I-Mean key. And it always inserts spaces (ASCII 0x20), not tabs (ASCII 0x09). The Tab key is good. But tab characters are bad.Tab characters have no place in modern source code. Their use is considered harmful and should be strictly avoided.
{ 4 } Comments