Grouping code by indentation - feature or ******?

Antoon Pardon apardon at forel.vub.ac.be
Fri Mar 25 09:26:28 EST 2005


Op 2005-03-25, John Roth schreef <newsgroups at jhrothjr.com>:
>
> "Antoon Pardon" <apardon at forel.vub.ac.be> wrote in message 
> news:slrnd482k3.20i.apardon at rcpc42.vub.ac.be...
>> Op 2005-03-25, Tim Tyler schreef <tim at tt1lock.org>:
>>> What do you guys think about Python's grouping of code via indentation?
>>>
>>> Is it good - perhaps because it saves space and eliminates keypresses?
>>
>> I think it was a mistake, but I'm probably in the minority here.
>
> Um, why?

1) It makes it hard to see how many levels are dedented at the end of
   a suite, and sometime makes it difficult to see where the end
   of a suite is. If e.g. you are looking at the code spread over
   two pieces of paper, it is sometimes hard to see whether the
   suite ends at the end of the first page or not.

2) It makes it hard to introduce some kind of new syntax constructs.
   Sometimes its isn't clear what would be the best indentation scheme
   for a syntantical structure, or some usefull syntantical won't fall
   in the indentation scheme that python provides. I think it a
   shame that these consideration would limit what constructs
   get into python or not.

3) Sometimes the structure of the algorithm is not the structure
   of the code as written, people who prefer that the indentation
   reflects the structure of the algorithm instead of the structure
   of the code, are forced to indent wrongly.

-- 
Antoon Pardon



More information about the Python-list mailing list