Is this a dream or a nightmare? (Was Re: XML)
Grant Griffin
g2 at seebelow.org
Sat Oct 7 16:34:41 EDT 2000
David T. Grove wrote:
>
...
> Granted, python is very close to Perl in these respects, but it's
> still more verbose.
That seems to be the popular mythology, but when I've rewritten some of
my old Perl scripts as Python, my experience has been exactly the
opposite: the Python versions invariably are smaller files which have
fewer lines. In fact, translation of Perl to Python mostly seems to be
a "deletion" process: eliminating braces, $, @, %, and my--as well as
manual function parameter list parsing (which--let's face it--is nothing
short of dopey by 21st-century programming-language standards ;-), etc.
Then again, maybe extensive use of one-liners in Perl could overpower
those other factors. (In my own case, I'm not big on Perl's one-liners:
even if I ever got really good at writing them, I'm pretty sure I
couldn't read them 10 minutes later.)
> Also, I must admit that "good programming practices" have hit me
> pretty hard recently, when I've had to babysit some newbies from
> another planet... er... country. My elses got unsnuggled and
>
> die unless @d = map {"$basedir/$_"} grep {!-d && -w} readdir(dir);
>
What in the heck does all _that_ mean?
> ...which is perfectly logical and readable to me as a single
> "thought"... "get me all the filenames in that directory or halt
> immediately because you'll screw something up".
OK, _now_ I see! 9If only Perl were as readable as a natural language.
<wink>)
if-i-were-designing-a-programming-language-with-the-express-purpose
-of-eliminating-lines,-i'd-pick-on-the-braces-before-the
-semicolons-(or-maybe-just-eliminate-both-<wink>)-ly y'rs,
=g2
--
_____________________________________________________________________
Grant R. Griffin g2 at dspguru.com
Publisher of dspGuru http://www.dspguru.com
Iowegian International Corporation http://www.iowegian.com
More information about the Python-list
mailing list