python vs perl lines of code

Ala Qumsieh notvalid at email.com
Wed May 17 01:03:44 EDT 2006


Edward Elliott wrote:
> John Bokma wrote:
>>
>>Without seeing the actual code this is quite meaningless.
> 
> 
> Evaluating my experiences yes, relating your own no.

Well, quality of code is directly related to its author. Without knowing 
the author personally, or at least seeing the code, your anecdote 
doesn't really mean anything.

A colleague of mine, who is efficient at programming, and pretty decent 
at Perl, routinely does something like:

   if ($var =~ /something and something else/) {
     $var =~ /(something) and (something else)/;
     my $match1 = $1;
     my $match2 = $2;
     ...
   }

Needless to say, this adds a lot of unnecessary redundancy, which will 
go towards increasing your character count. Being an avid Perl Golfer 
(although not one of the best) I can almost guarantee that any python 
code can be written more succinctly in Perl, although readability will 
suffer. Plus, the extensibility argument is very subjective, and is 
closely related to personal coding style.

Btw, do you include space chars that go toward indentating Python code 
in your count? If not, you should since they are required. Not so for Perl.

--Ala




More information about the Python-list mailing list