Why use Perl when we've got Python?!

Abigail abigail at delanet.com
Sun Aug 15 12:40:40 CEST 1999


John Stevens (jstevens at bamboo.verinet.com) wrote on MMCLXXIV September
MCMXCIII in <URL:news:slrn7rb2s2.cf9.jstevens at bamboo.verinet.com>:
%% On 14 Aug 1999 02:55:19 GMT, Eric Bohlman <ebohlman at netcom.com> wrote:
%% >John W. Stevens (jstevens at basho.fc.hp.com) wrote:
%% >[quoting someone whose name was lost]
%% >: > It is wrong from the Larry's principle that things that behave
%% >: > differently should have different appearances.
%% >: 
%% >: Then why doesn't Perl have two different operations for
%% >: assign/reassign, vs. add to an array?  A tiny little violation of
%% >: Larry's principles, that.
%% >
%% >Nope.  "Behave differently" hear means "accomplish two different tasks."  
%% >Comparing two strings to see if they're equal lexically is not the same 
%% >task as comparing two strings to see if they're equal numerically.  
%% 
%% Right.  Do you see what I am saying?  Automatic coercion (from string to int)
%% created a problem.  The problem was dealt with by making a change that
%% impacts the language.

What's next, different types for prime numbers and non-prime numbers?

%% As well as providing a huge opportunity for defects, the complexity
%% of the language was increased.

Look. All we've seen from you here is a 4 line Python program,
riddled with bugs. And your Perl knowledge is at the same level as my
hair dressers.  All that proves is that you are in desparate need of
something that protects you from making mistakes, and that Python isn't
giving you that.

%% >Putting a particular value in a particular position in an array that 
%% >already holds a value *is* the same task as putting a particular value in 
%% >a particular position of an array that does not yet hold a value; the 
%% >only difference is in the internal details of how to accomplish it.
%% 
%% Yes, but the context of this was TC's comparison with Python's lists.
%% 
%% For an ARRAY, your argument makes sense.  For a list, it does not,
%% yet TC was taking Python lists to task for not acting like arrays.
%% 
%% On the other hand, Perl's behavior encourages defects:
%% 
%% $array[$index] = $newWord;
%% 
%% The program ran for a very long time, then the system started thrashing,
%% then it core dumped.
%% 
%% The value of $index?  Very, very large.  Perl happily tried to allocate
%% Gigabytes worth of core.

Well, then don't do that then. Djees. Consider a Python equivalent:

    while len (array) <= index + 1:   # Why isn't that array.len() ???
        array.append (0)
    array [index] = newWord;

Would that somehow magically have prevented index not to be large?

%% For example (another real bug, here):
%% 
%% $result = $Total / $count;
%% 
%% Generated a division error.  $count contained the string: "Payroll". . .


And in Python it would produce some result?



Abigail
-- 
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(
HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (
LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET",
"http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content))
=~ /(.*\))[-\s]+Addition/s) [0]'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----




More information about the Python-list mailing list