Is python really slow?

Iain Truskett news at dellah.anu.edu.au
Fri May 31 01:02:01 EDT 2002


in article 83adqsis0w.fsf at panacea.canonical.org, Kragen Sitaker at
kragen at pobox.com wrote on 22/05/02 5:02 PM:
> 2. Perl programmers have a lot of basic problems with things like
> failing to open files, leaving variables uninitialized, and
> accidentally clobbering global variables that are inadvertently shared
> between different parts of a program.

Well, you get that when people don't use warnings or strict. And they don't
check their error conditions.  Some of this is being remedied in Perl 6. See
www.perl.com for the Apocalypses and Exegeses of the design process (should
be a new pair out next week, covering regular expressions).

PHP programmers have it worse with variables that they don't initialise. At
least if they don't use the newer features of the language. Using the
automatic variable assignation from the HTTP parameters and not defining any
variables you are using can lead to variables having values which they
aren't meant to. Can lead to security problems.

Perl at least lets you use a taint mode so that unchecked input is not
usable until it's been checked.

I'm only a beginner in Python, so I'm afraid I can't compare there. Probably
covered in a FAQ (I'd check, but my ISP's external access appears to have
died - so all I can play with is the news server and the mail server).

The thing is, you can program badly in any language - some just protect you
a bit more. Not 'use'ing the warnings or strict pragmas in Perl is like not
checking the values of pointers in C, or your array indices.

> Python catches these errors and
> tells you about them, so you don't need to post to a newsgroup to find
> out what went wrong.  Fewer basic questions means the advanced
> questions constitute a greater portion of the traffic.

Well, Perl catches the file errors, and it lets you handle them however you
like. If you don't handle them, then it won't. It can also catch the others
- you just have to ask it to. Sometimes you may not want it to.

[My apologies if this is weirdly formatted - I'm having to use Outlook
Express rather than my preferred slrn+vim]


cheers,
-- 
Iain.




More information about the Python-list mailing list