tabbing probs

Michael mogmios at mlug.missouri.edu
Mon Mar 29 11:54:16 EST 2004


>As long as you are the only one to work on your code, your 
>viewpoint may not cause you any problems. I and others are telling 
>you that tabs can cause problems with some software, and you can 
>rightly avoid using that software as long as you don't share your 
>code. Once that happens, though, things get more complicated.
>  
>
That's what you're saying but what I'm hearing is that using tabs + 
spaces causes problems with some (crappy) software. If I start using an 
editor that only allows uppercase letters is Python going to disallow 
lowercase letters to solve a problem with my editor? I'd hope not. 
Likewise it makes no sense to remove tab indenting because some software 
has a problem with the difference between tabs and spaces.

>One aspect of the tab/spaces issue involves working on other 
>people's code. You like tabs, I like spaces. Supposing that I 
>prefer to show a single level of indention as five spaces (for some 
>reason), what happens when I have to make a change to your code? If 
>I am aware that you use tabs, then I can adjust to it, but how do I 
>become aware? To me, it looks like you're putting five spaces in 
>for each level of indention. The chances are that I won't know 
>otherwise until I've made some changes, saved the file and tried to 
>run it. If some of those changes involve changing an indention 
>level, I may insert spaces before or after your tabs, so now such a 
>change leaves a line with mixed tabs and spaces, but no visible 
>indication of which is where. Now when someone else grabs the code 
>and displays it with tabs set to four spaces instead, what happens? 
>No sympathy there, either, I would bet, but you do see how things 
>like that can happen even using only your tools, don't you?
>
Couldn't you just look at the code and see that it's using tabs or 
spaces as long as it's uniform? How hard is it to tell the difference? 
Or is it that your editor makes spaces look like tabs so that it's 
difficult to tell? I can see how it could be a problem. I just can't see 
how making tabs not work will fix the problem. If anything I'd make it 
so one whitespace character counts as one level of indention.. 
regardless to if your editor shows you the fact. Using multiple spaces 
or tabs or a combination thereof which don't add up correctly to the 
required indention level should just throw an error. That's closer to 
what happens currently and it makes more sense to me than limiting 
indenting to using only spaces. I think the problem will exist as long 
as whitespace is significant but I happen to have grown fond of Python's 
use of whitespace.





More information about the Python-list mailing list