Please verify!!

Steven D'Aprano steve+comp.lang.python at pearwood.info
Fri Feb 24 13:20:27 CET 2012


On Fri, 24 Feb 2012 03:18:18 -0600, Andrew Berg wrote:

> On 2/24/2012 2:32 AM, Ben Finney wrote:
>> Are you referring to novice programmers – who, by any reasonable
>> definition of “novice”, don't have an opinion on the tabs-versus-spaces
>> indentation debate?
>> 
>> Or are you talking about people who are experienced enough to have an
>> opinion and expect their editor to allow them the choice?
>
> The former. Opinion doesn't necessarily come with experience - habit
> will usually override any minor reason to change. My point is that one
> should have an opinion on it, not just be told which is better. I should
> clarify that I mean that in a general sense as well, since it may have
> come across as a bit of an overreaction.

"My opinion is that we shouldn't use either tabs or spaces, but capital 
Zs instead, 'cos I like Zs and we don't use enough of them!"

Opinions need to be informed to be better than useless. By definition 
newbies don't have the experience to have informed opinions. You are 
encouraging people who lack the experience to make an informed decision 
to take sides in the "tabs vs spaces" question on the basis of... what? 
Gut feeling? Astrology? Feng shui? Whether they find it easy to say the 
word "space" or have a lisp and prefer "tab" instead?

There are many times that we can't afford to sit on the fence. Lacking 
experience to decide between spaces and tabs, we can't just say "I won't 
use either", or "I'll use both" (unless you do so in separate files). So 
how can we make a decision?

The usual way is to listen to others, who do have the experience to make 
a decision (even if only imperfectly). But you've just told us off for 
passing on our experience/opinions to newbies, so in effect you're saying 
that people shouldn't learn from the experiences of others.

That, I think, is a terrible philosophy. Life is too short to gain an 
opinion for ourselves about everything, and too difficult to sit on the 
fence.

The right way is to encourage newbies to listen to the arguments put 
forth, and *then* make up their own mind, or in the absence of easily 
understood arguments (let's face it, many technical decisions only make 
sense after years of study, experience or careful reasoning) on the basis 
of any consensus amongst experts. Often there may be no absolutely right 
or wrong answers.

Personally, I prefer tabs for theoretical reasons and spaces for 
practical ones. I think that the world would be better off if we all 
standardised on tabs instead of spaces, but since that's not going to 
happen, I can interoperate better with the mass of broken tools out 
there, and with other people, by using spaces.

I wonder whether Windows users tend to be more sympathetic to tabs than 
Unix/Linux users, and if so, I wonder what if anything that means.


-- 
Steven



More information about the Python-list mailing list