Python indentation

Grant Edwards grante at visi.com
Wed Jul 7 18:56:11 CEST 2004


On 2004-07-07, Reinhold Birkenfeld <reinhold-birkenfeld-nospam at wolke7.net> wrote:

>> In C, we have 10 lines
>> 
>>   if (condition)
>>     {
>>       doThis();
>>       doThat();
>>     }
>>   else
>>     {
>>       doWhatever();
>>       andSoOn();      
>>     }    
>
> Well, one could apply another coding style in this example:
>
> if (condition) {
>   doThis();
>   doThat();
> } else {
>   doWhatever();
>   andSoOn();
> }
>
> which only takes 7 lines and is not much less readable.

Maybe for some people, but I've never been able to read C code
like that. I always have to run it through 'indent' to put the
braces on separate lines.  When working on code that requires
'old-style' indentation, the process is:

 1) run it through indent so I can read it
 2) edit/compile/test
 3) run it through indent again to restore old indentation

> But I agree with you!

:)

-- 
Grant Edwards                   grante             Yow!  It's a lot of fun
                                  at               being alive... I wonder if
                               visi.com            my bed is made?!?



More information about the Python-list mailing list