Compare source code

Grant Edwards invalid at invalid.invalid
Tue Nov 2 19:15:03 CET 2010

On 2010-11-02, Seebs <usenet-nospam at> wrote:
> On 2010-11-02, D'Arcy J.M. Cain <darcy at> wrote:
>> You have problems.  Indentation as syntax isn't one of them.
> In the absence of indentation as syntax, they haven't bugged me.
>> "No one
>> knows why" email is being "magically" transformed?
> Yay for a large company IT department with both MS and Blackberry
> stuff involved.
>> Your editor has a
>> mind of its own?  Yikes!
> It is extremely useful to me to have spaces converted to tabs
> for every other file I edit.
>>> I've lost more time to indentation issues in Python in a month than
>>> I've lost to mismatches between indentation and flow in C in twenty
>> Your experience is 180 from mine.
> Could be.  But really, I've simply never seen a real problem with
> flow/indentation mismatches in C.
>>> At least in C, if I see:
>>> 	if (foo)
>>> 		a;
>>> 	else
>>> 		b;
>>> 		c;
>>> I *know* that something is wrong.
>> Does it look right?  With Python looking right and being right are the
>> same thing.
> No, they aren't.  See... That would work *if I knew for sure what the intent
> was*.
> 	if foo:
> 	    bar
> 	else:
> 	    baz
> 	    quux
> Does it look right?  We have *no idea*, because we don't actually know
> whether quux was *intended* to be in the else branch or whether that's a typo.
> So the only way I can figure that out is by fully figuring out the function
> of all the code bits -- meaning I have to fully understand the code, same
> as I would to debug the C.  The fact that indentation is flow control
> just means I have only one set of cues, so I can't watch for mismatches.

You can add redundant, semantically empty structure info to Python
programs just as easily as you can to C programs:

    if foo:

Grant Edwards               grant.b.edwards        Yow! With YOU, I can be
                                  at               MYSELF ...  We don't NEED
                                Dan Rather ...

More information about the Python-list mailing list