On 24/07/2016 14:24, Chris Angelico wrote:
On Sun, Jul 24, 2016 at 11:09 PM, BartC <b...@freeuk.com> wrote:
Actually this is a good example of how tabs can go wrong (and how the tab
system /is/ fragile - sorry but it is).

I almost certainly wrote the above using 4 and 8 spaces for the tabs, except
for the 'return 1' where I must have used an actual tab by mistake. (And I
tested it now by doing just that, and posting in alt.test.)


No, it's an example of how *mixing tabs and spaces* can go wrong. And
in fact will always go wrong unless you legislate the width of a tab.

That's easy to say. How do you actually ensure that they aren't mixed? The software may not highlight the difference.

I use 100% tabs in my editor. While in Thunderbird, I have to use 100% spaces otherwise it will screw up. But what stops me pressing tab out of habit? The code looks right, I post it, and if it then goes wrong, I might not notice. Nor would anyone else.

Also, sometimes you want to paste code into Thunderbird that contains tabs; that can be erratic too.

And very often I want to post other people's code that is full of spaces (notably from Thunderbird), into mine that is full of tabs. (I have the same problem with other languages, but there it's largely cosmetic.)

So I still think it's fragile, meaning you have to take a lot of extra care.

--
Bartc
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to