http://www.perlmonks.org?node_id=156355


in reply to Perl vs. Python: Looking at the Code

i have to agree with the other posts that the terseness of some of the syntax is a pretty poor way to compare two languages.

especially when all the examples are chosen with a bias. let's look at some other aspects of the syntax:

#perl $foo .= $bar;
#python foo.append(bar);
# perl $foo =~ s/\W//g;
#python import re foo = re.sub(foo,'\W','')

my point is that with contrived examples, you can probably argue it any way you want. with perl's flexibility i've found that i can write overall shorter programs in perl than in python even if some of the individual statements are longer.

if all you care about is terse syntax, you'll love colorForth: here's an IDE driver written in one page of code.

anders pearson

Replies are listed 'Best First'.
Re: Re: Perl vs. Python: Looking at the Code
by raptor (Sexton) on Jun 29, 2002 at 15:05 UTC
    one other thing that comes in my mind AFAIK python has several RE modules (as do much of the other languages)... and guees how they call them :
    "Perl compatible regex"
    :") so if i look only one side i.e the RegEx side of view, 'cause the poster does exactly this ...
    ps. the bad thing is that from after a year or so they will say "Perl5 compatible regex", 'cause perl6-compatible-regex they will not have in the near 5years atleast :")
A reply falls below the community's threshold of quality. You may see it by logging in.