[vox-tech] hold on to your hats - perl vs python

Tim Riley vox-tech@lists.lugod.org
Fri, 19 Jul 2002 09:36:58 -0700


Peter Jay Salzman wrote:

> jeff newmiller got me thinking about switching from perl to python as my
> main scripting language of choice.
>
> i'd like to hear the opinions of anyone who has actually MADE the switch
> from perl to python as their scripting language of choice.

I never embraced perl over sh because of the arcane syntax and learning
curve required. After all, if I needed to anything outside of the
language's features, I could just fork a sub process and capture the
results.

As a general rule, code readability is more important to me than code
succinctness
and minimizing cpu cycles. When in 6 months a feature needs to be added,
I value my time and mental health over the extra milliseconds
the script takes to run.

Therefore, I was enthralled when I was introduced to Python by an article in
the
"Linux Journal." The feature that struck me most was the ease of executing a
function
as a script. For example, let's say you wrote the function:

def get_free_k_bytes( filesystem_string ):
    /* Do the work to extract the k bytes free for a filesystem */
    return k_bytes_free

Then you could easily include this function in other scripts that
need to make sure there's enough disk space to proceed. Moreover,
you could add a "main" at the bottom of the script to run it as an
executable to output the k bytes free now.


>
>
> was python everything you had hoped for?  was there anything you had in
> perl that seems to be missing from python?  perl certainly seems to have
> a never ending supply of packages, but i understand python is being
> developed quickly too.
>
> looking for subjective experience here.  not enumerations of the virtues
> of python or perl.
>
> thanks,
> pete
>
> --
> GPG Fingerprint: B9F1 6CF3 47C4 7CD8 D33E  70A9 A3B9 1945 67EA 951D
> _______________________________________________
> vox-tech mailing list
> vox-tech@lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox-tech