Re: [SLUG] Python vs Perl

From: Derek Glidden (dglidden@illusionary.com)
Date: Thu May 10 2001 - 14:49:47 EDT


Mikes work account wrote:
>
> This is not intended to start any sort of long winded thread or flame about
> either programming language but,,, I need ot pick a programming language to
> learn and both of these have their proponents. Does anyone out there have
> constructive things to say about either one or both of these and their
> strength or weaknesses. I need to write short programs that access a data
> base and manipulate data and output in presentable for on the printer.
> And,, I don't want to spend the rest of my life learning it,,,

The reason language comparisons are likely to start religious wars is
because they're remarkably like comparing two religions....

(note that I have a lot more experience with Perl than Python)

Perl Pros: very forgiving syntax, extremely easy to pick up and start
hacking since syntax can be learned incrementally, essential philosophy:
"There's More Then One Way To Do It" (TMTOWTDI) means many different
approaches to the same problem all will likely work in the end, an
absolute butt-load-and-a-half of third-party extension modules available
through CPAN, effectively universal since it's on nearly every platform
by default anymore

Perl Cons: syntax can easily get squirrely and ugly and unreadable very
quickly, forgiving syntax also makes it easy to make stupid mistakes
that get overlooked, TMTOWTDI means that any examples you see for the
same problem are likely to all be entirely different making it more
difficult to pick up more complex language capabilities, structured
programming in perl requires a LOT of self-control, a good percentage of
those buttloads of third-party modules don't always, err, behave the way
you might expect (i.e. a lot of 'em don't work)

Python Pros: entirely object-oriented language structure requires some
thought about overall program structure before jumping into a Python
project which is a Good Thing, language syntax *requires* that your
programs look nice and are easy to read, acts more like a "real
programming language" than a quick-off scripting language on steroids,
philosophy of There Should Be One Obvious Way To Do It means it's easy
to adapt other examples/code to your own purposes

Python Cons: language is intended to be entirely object-oriented which
causes some people to break out in hives, not as large set of
third-party modules available, language interpreter is not on many
platforms by default, more difficult to pick up and start working with
since you need to learn a much larger portion of the language syntax as
a whole before doing much with it, goofy whitespace-based
scoping/structure makes programmers think of FORTRAN

Both Cons: respective language bigots don't like people saying bad
things about their language or good things about the other...

-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#!/usr/bin/perl -w
$_='while(read+STDIN,$_,2048){$a=29;$b=73;$c=142;$t=255;@t=map
{$_%16or$t^=$c^=($m=(11,10,116,100,11,122,20,100)[$_/16%8])&110;
$t^=(72,@z=(64,72,$a^=12*($_%16-2?0:$m&17)),$b^=$_%64?12:0,@z)
[$_%8]}(16..271);if((@a=unx"C*",$_)[20]&48){$h=5;$_=unxb24,join
"",@b=map{xB8,unxb8,chr($_^$a[--$h+84])}@ARGV;s/...$/1$&/;$d=
unxV,xb25,$_;$e=256|(ord$b[4])<<9|ord$b[3];$d=$d>>8^($f=$t&($d
>>12^$d>>4^$d^$d/8))<<17,$e=$e>>8^($t&($g=($q=$e>>14&7^$e)^$q*
8^$q<<6))<<9,$_=$t[$_]^(($h>>=8)+=$f+(~$g&$t))for@a[128..$#a]}
print+x"C*",@a}';s/x/pack+/g;eval 

usage: qrpff 153 2 8 105 225 < /mnt/dvd/VOB_FILENAME \ | extract_mpeg2 | mpeg2dec -

http://www.eff.org/ http://www.opendvd.org/ http://www.cs.cmu.edu/~dst/DeCSS/Gallery/



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 16:21:26 EDT