Python indentation deters newbies?
Antoon Pardon
apardon at forel.vub.ac.be
Mon Aug 16 10:24:25 EDT 2004
Op 2004-08-16, Peter Hansen schreef <peter at engcorp.com>:
> Antoon Pardon wrote:
>
>> Op 2004-08-16, Peter Hansen schreef <peter at engcorp.com>:
>>>Did you really not indent your code in those languages consisntly
>>>anyway?
>>
>> I can't answer for keith, but my answer is that it depends on
>> what you consider consistent.
>>
>> My indentation was consistent with the structure of the algorithm.
>> That is not necesarrily the same as the structure you implemeted
>> that algorithm in.
>
> Huh? How does an algorithm have structure that affects
> indentation? It sounds like you are talking about some kind
> of artistic considerations here.
Simple: not all languages provide the same control structures.
So you have to use the control structures that are available
to simulate the control structure you really want to use.
>> I think that I should be the final judge of what is the most
>> appropiate way to use indentation, not the compilor/interpreter,
>> even if it agrees with me.
>
> So did you indent your code such that consecutive lines were
> not indented to the same identation level even when they were
> conceptually, logically, *algorithmically* part of the same
> block?
No, but although they were *algorithmically* not in the same
block, due to lack of control-structures they had to be
implemented as being in the same block. In a language as
python, this would force IMO the indentation to be wrong.
> I know there are such people out there. I even had to fire one
> once, roughly because he had no concept of how his failure to
> write his code with anything resembling consistent indentation
> meant that it was unreadable to others. (At least, that was the
> surface symptom which warned us of deeper problems.) What I
> doubt is that many of those people are out there rejecting
> Python just because it doesn't let them write god-awful unreadable
> code with artistic or random indentation.
I don't reject python. There is still no language I find perfect.
I find python usefull and use it regularly, despite the details
I don't like about it. I don't like the enforced indentation,
even if I agree 99.99% of the time with the indentation python
enforces.
--
Antoon Pardon
More information about the Python-list
mailing list