Python vs. Perl, which is better to learn?

Alex Martelli aleax at aleax.it
Sat May 11 05:33:54 EDT 2002


Jeff Shannon wrote:
        ...
> *need* to reindent code anyhow, to make it comprehensible, so
> complaining that Python requires that is silly.

Just to play devil's advocate: in VStudio, I just hilighted any
block, hit an Fkey, and the block got laid out reasonably, including
any nested blocks &c.  The editor could do that because it relied
on braces to demarcate blocks, of course.  Lacking those _is_ a
(tiny) handicap coming from not requiring block-demarcation (I still
think it's a big win overall, but let's give the devil its due too).


> (Besides, back when I used to do C++, when I refactored I always
> had to spend time doublechecking that both the moved code and the
> area it was cut from had the proper number of braces.  At least
> with indenting, the issue is easily visible.

Find-matching-paren makes short work of that.  If anything, the
problems with refactoring in C++ or Java come from their horrid
choice of leaving this / self *IMPLICIT* -- so a reference to
any name X may or may not mean self.X / this->X and the poor
editor can hardly help you with THAT as you move code between
classes (or, in C++, from in-class to out-of-class)...


Alex




More information about the Python-list mailing list