Tabs -vs- Spaces: Tabs should have won.

Ian Kelly ian.g.kelly at gmail.com
Sun Jul 17 03:32:59 EDT 2011


On Sat, Jul 16, 2011 at 9:09 PM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
>> Personally, I like to use the tab _key_ as an input device, but to have
>> my editor write real spaces to the file in consequence. With pure
>> spaces, the text is laid out reliably for us both. And so I have my
>> editor set to that behaviour.
>
> I have reluctantly come to do the same thing. There is a plethora of broken
> tools out there that don't handle tabs well, and consequently even though
> tabs for indentation are objectively better, I use spaces because it is
> less worse than the alternative.

This.  I used to think that tabs were better, for pretty much the
reasons Rick outlined, but I've had enough problems with editors
munging my tabs that I eventually found it simpler in practice to just
go with the flow and use spaces.

Of course, there is also another major problem with tabs that I have
not seen pointed out yet, which is that it's not possible to strictly
adhere to 80-column lines with tabs.  I can write my code to 80
columns using 4-space tabs, but if somebody later tries to edit the
file using 8-space tabs, their lines will be too long.  Rick's answer
to this might be to just mandate that everybody uses 4-space tabs, but
then this would pretty much defeat the purpose of using tabs in the
first place.



More information about the Python-list mailing list