Python vs. Perl, which is better to learn?

David J. Ritchie ritchie at fnal.gov
Fri May 10 11:21:42 EDT 2002


Greg Ewing wrote:

> "David J. Ritchie" wrote:
> >
> > I must admit that ... indentation is a pain.
>
> So what do you do when you have to move blocks
> of code in a non-indentation-sensitive editor?
> Leave the indentation ragged? Or use a suitably
> talented editor...?
>
> --
> Greg Ewing, Computer Science Dept, University of Canterbury,
> Christchurch, New Zealand
> To get my email address, please visit my web page:
> http://www.cosc.canterbury.ac.nz/~greg

As for example, when I am stuck with a slow line, ed, or vi...
If it's perl and its a quick and dirty hack job, I just leave it
ragged.  The nice thing about perl is it doesn't care.  If I think
I'll have to live with it, I'll indent it appropriately so I can have
a prayer of understanding it later.

If it's python, of course I adjust it to make it work.  But what
I do is only relevant as an example of how some segment of
the populace composes text--whether that text is to be read
and understood only by humans or by humans and computers.

In my look at how composition is taught in language arts
in the second or third grade, I find that there is an emphasis on
getting the kids to put down their ideas in a way that at least
reminds themselves of what they were trying to say and then
encourages them to read the work outloud, check it for
understandability, and then to make the work more understandable by
a process of successive editing and molding of the text into
recognized and accepted forms.

I find I write that way in draft form and that it is effective at
getting my ideas into text form.  Isn't there something to be
gained by devising a computing language which lets you take
that approach--rather than putting strictures on you very early
before you've even understood what it is that you want to
communicate to the machine?

If so, then a computer language that lets you move blocks of
code around easily is an advantage.  With Python, it is clear
that you need to augment the language with a suitably capable
editor if you adopt that composition style.  Maybe it's just the
beginning of the indication that one should be composing--not
in a text editor at all--but in a design tool that generates the
text--that's sort of what the popularity of the "visual xxx" things
are saying...

--D.

--
ritchie at fnal.gov
http://home.fnal.gov/~ritchie/





More information about the Python-list mailing list