Is this a dream or a nightmare? (Was Re: XML)

David T. Grove pete at petes-place.com
Sat Oct 7 19:02:42 EDT 2000


On Sat, 7 Oct 2000 23:35:02 +0200, "Alex Martelli" <aleaxit at yahoo.com>
wrote:

>"Frank Sergeant" <frank at canyon-medical.com> wrote in message
>news:MqLD5.1338$G5.25319 at read1.centurytel.net...
>    [snip]
>> I noticed on the web site that you said
>>
>> > The true beauty of perl is shown in how rapidly a program can be
>created:
>> > a good average for comparison is 1 line of perl for every 25 lines of C,
>> > TclTk, Python, or Visual Basic, and every 100 lines of C++.
>
>Such an assertion can only come from a mind that's totally out of
>synch with reality.  400% *more* lines of code for C++ than for

OOP over a procedural language has more lines, no matter how you look
at it. C++ is especially guilty in this, because for "standard" C++,
in certain areas like the STL, you end up programming classes with
overloaded operators just to begin coding... not much of a time saver
over basic ADT's from a programmer's pov. OOP can be a convenience
when it comes to hiding code, but there's code in that black box, and
it has to be anough to make it work. Plus in C++, though not in all
object languages, you have syntactic overhead (a.k.a. fluff). Even
Stroustroup complains about this in "The Design and Evolution of C++".
But then, what do you expect from a language that trades no strings
with bad strings. ;-)

>C?!  That's even crazier than the 2500%-more assertion for Python

If that's all you saw in that line, you're not paying attention. The
comparison is not based on just everyday programming, but what
programming can be in its worst case. Perl is notorious for one-liners
that take other languages anywhere from multiple lines to hundreds of
lines to reproduce, especially where text processing and data
structures are concerned. Regular expressions in Python/Tcl/Perl are
unbelievably abbreviated over the huge character-by-character
equivalents of pascal, c, vb, and other languages without them. Python
and Perl are pretty unique in that they allow arbitrarily nested data
structures.

Anyway, if you'll notice, I did some lumping there, not hard figures
for each language. You take it any way other than lumping, you're
misreading the text and skipping the meaning behind it.

Granted, python is very close to Perl in these respects, but it's
still more verbose.

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);

...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". Single thoughts don't
translate into code very well without one-liners like this, because
you're so busy with sub thoughts that you forget what you're
programming until your current thought is done.

became multiple lines, most of which hold just a { or a }.

Without the newbies, you can't match it with any python that I'm aware
of. But then, I was also comparing VB and C in there, and I challenge
anyone to do that in less than 25 lines of C or VB (1 line = 1
semicolon per line, no cheating)

>vs Perl.  If this quote is correct, then the site must clearly be one
>devoted to silly humour.

Bah. Be nice and pay attention. You just totally zapped the entire
meaning of this thread. I'm not python-bashing... quite the opposite
if you'd take time to read up a little in the thread.





More information about the Python-list mailing list