Re: python vs perl lines of code



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

.



Relevant Pages

  • Dynamic Execution question
    ... I am new to Perl and have a question. ... Python code to Perl for the project I am working on and I need to know how ... Using an hash, select a string from the ... Using another string in the same hash, execute a function in the dynamically ...
    (perl.beginners)
  • Re: Becoming Disenheartened - Everyone talks about Python and says Perl is old news.
    ... But look at this Python code: ... Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. ... See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! ...
    (perl.beginners)
  • Re: rename file based on files timestamp
    ... I can write some Python code to do this, but maybe there is another way, ... perhaps using a shell script. ... A script is a script whether it is in Python, Perl or one of the common ...
    (freebsd-questions)
  • Re: Programming Languages, "to C or not to C, that is the Q."
    ... > I beg to differ. ... It isn't that Perl cannot be well indented and "well ... > Perl code, when one removed the braces, resembled my Python code. ... You can write clear or befuddled code in any language ...
    (Debian-User)
  • Re: hash defining
    ... Perl would have told you that %energies ... Here's where you define %energies. ... Compile-time error messages? ... The quality of an answer is directly proportional to the quality of the ...
    (perl.beginners)