Compare source code

Grant Edwards invalid at invalid.invalid
Tue Nov 2 14:22:57 EDT 2010


On 2010-11-02, Emile van Sebille <emile at fenx.com> wrote:
> On 11/2/2010 10:58 AM Seebs said...
>> 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.
>
> What is right is that there's no question that quux is subsequent to baz 
> in all cases barring exceptions (and assuming no tabs intermixed)
>
> The apparent structure in python _is_ the structure, whereas otherwise 
> you've got to count your ;'s and {}'s etc to determine and verify the 
> structure matches the apparent structure provided by the programmer.
>
> Whether that's what the specs called for or not is always a source
> for bugs.

Yup.  I've never found that the ability to write incorrect code that
_appears_ correct to be a good thing.  Nor do I find the ability to
write correct code that appears to be incorrect to be valuable.

In Python, if the structure looks right, then structure _is_ right.

-- 
Grant Edwards               grant.b.edwards        Yow! Now we can become
                                  at               alcoholics!
                              gmail.com            



More information about the Python-list mailing list