Compare source code

Seebs usenet-nospam at seebs.net
Tue Nov 2 18:58:06 CET 2010


On 2010-11-02, D'Arcy J.M. Cain <darcy at druid.net> 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.

-s
-- 
Copyright 2010, all wrongs reversed.  Peter Seebach / usenet-nospam at seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
I am not speaking for my employer, although they do rent some of my opinions.



More information about the Python-list mailing list