3 ms·
I chose spaces over tabs long before I started writing Python. The issues with tabs are: (1) Some editors will autoconvert them to spaces. Every time you swi
by csense 14y ago
I chose spaces over tabs long before I started writing Python. The issues with tabs are:
(1) Some editors will autoconvert them to spaces. Every time you switch editors, switch IDE's, edit your code on a different computer, or let someone else work on it, you have to remember to make sure your tabs are still there.
(2) With tabs, your code will look different for different people. I often line up parts of adjacent lines that are symmetric, and different tab widths will interfere with this. Ditto ASCII art in comments.
(3) It's hard to use tabs consistently because tabs and spaces are visually identical in most editors. (This is less of a problem in Python than other languages, because inconsistent tabs/spaces in your indentation are often caught quickly because they cause syntax errors.)
(4) My mathematical mind admires systems that are designed around simple and elegant ideas. A character display embodies the following two such ideas:
(a) Each location on the screen contains exactly one character.
(b) There is a one-to-one mapping between the pixel contents of an 8x8 box (or however big your font is, assuming all sane people use monospace fonts for coding) and an ASCII character. (Don't get me started on Unicode. I don't understand it, don't use it, and it haven't had it do anything for me but cause bizarre problems [1].)
Tabs break both of these properties. This causes cognitive dissonance and offends my sense of aesthetics.
[1] http://news.ycombinator.com/item?id=4369323 http://news.ycombinator.com/item?id=4369323