What is Python?

Tim Hammerquist tim at degree.ath.cx
Wed Sep 20 13:14:05 EDT 2000


Grant Griffin <g2 at seebelow.org> wrote:
> Of course, I don't expect that eveyone will share this sensibility; if
> Perl makes sense to _you_, more power to 'ya.  But I did it off-and-on
> for three years, and my fingers did a lot of walking through the
> camel--they probably walked a mile for it.

I found I had to do a lot of extra research to become fluent in Perl as
well.  However, nothing truly worthwhile comes too easily, right?  ;)

> But my own theory is that Perlers actually revel in the nonsensicalness
> of their language, much as a tight-rope walker proudly calls attention
> to his lack of a net.  <<karl walenda died>>  It's an ego thing.  That
> explains the one-liners and the "just another perl hacker" thing.  

We do, to a point, revel in this.  And ego is definitely rampant in
clpm.

> By the way, here's my own personal Python JAPH implementation:
> 
> 	print "just another perl hacker"

Coincidentally, and I don't want to hurt your pride, but this is also
Larry Wall's implementation.  Apparently he has also become tired of all
these cutesy little tricks.  Of course, Larry would remember to put a
semi-colon after that statement if there were more than one statement in
the codeblock... would you?  ;)

> But in terms of your point about "the best tool for the job", one _does_
> have to admit in all fairness that there's at least _one_ thing that
> Perl is an order-of-magnitude better at than Python: execute Perl
> scripts.

How 'bout regexps?  Perl didn't create regexps, so why bag on them as
some in this thread have done?  Unix operations demanded the existence
of regex pattern matching and Perl, which was so obviously derived from
several Unix tools, accomplishes them very well.  I've noticed Pythoners
like to stand on soapboxes and look down on regexps. ("A true Python
solution wouldn't use regex's.")  Why look down on something so
powerful?  Regexps are optimized for matching text against patterns as
quickly and efficiently as possible, whereas you can only have so many:

	if 'x' in word:

statements before you're bloating your code unnecessarily.  I agree
that:

	if( $char =~ /^a$/ ) {...}

would be much more efficiently implemented as:

	if( $char == 'a' ) {...}

but more complicated patterns are just not worth replacing with a system
of if statements.

The fact that Perl makes regexps so readily available and easy-to-use
probably contributed to their over-use, but Perl isn't the only language
that can be misused, is it?

> But I guess if the mettle of a scripting language is to be judged by its
> one-linerability, I should confess that Python is a dismal failure: if
> you put together its use of indents for blocks, with the fact that none
> but its most elemental functions are built-in...well...it's hardly

What elemental functions aren't built-in?  I was under the impression
that core modules were built-in, they simply exist in a separate
namespace?

> show-me-a-language-that's-great-for-one-liners-and-i'll-show-you
>    -a-language-that-doesn't-scale-well-<wink>-ly y'rs,

Perl 5 took great strides toward scaling.  I would personally prefer to use
Python for a larger scale app, but Perl is more than capable of doing it
quite well.

-- 
-Tim Hammerquist <timmy at cpan.org>
Universities are places of knowledge. The freshman
each bring a little in with them, and the seniors
take none away, so knowledge accumulates.
	-- Unknown



More information about the Python-list mailing list