[TriLUG] The thin line...
Aaron S. Joyner
aaron at joyner.ws
Thu Sep 28 19:24:18 EDT 2006
Daniel Sterling wrote:
> Aaron S. Joyner wrote:
>
>> I was a big perl fan, but it's reasonably discouraged at Google
>> these days, so I don't do any new code, just the occasional maintenance.
>>
> Perl discouraged? For serious? By whom? Why for?
>
> Just cuz python is better? :)
>
> -- Dan
>
For a lot of reasons, but the primary ones often cited are that perl is
a very loose language, where the unofficial moto is literally "there's
more than one way to do it". This leads to a cultural encouragement of
very concise, often obscure code. It's something I can appreciate, in
that I like making one liners that take even the best of us a few
moments of staring to parse, but that's not a good way to create
maintainable code. Python is generally more verbose, some style is even
implicit in the formatting, resulting in generally more readable code,
which is thus more maintainable, on average. Before everyone jumps to
the defense of Perl, let me say that I'm quite confident you, and
everyone else on the list are adhereing to good style guidelines and
writing equivalently-readable perl as you are python. It's not you that
we're worried about, it's just the general nature of the language and
it's syntax.
Also, there's definitely something to be said for steering everyone
towards one language. There's no sense in everyone having to know perl,
ruby, python, php, c, c++, java, lisp, fortran, etc, etc, ad nauseum -
just to be able to be on-call and deal with an edge-case bug in some
script you wrote 6 months ago. Thus, having a standard is good, and
means everyone sleeps better at night and gets their weekends to
themselves. :)
Having said all that, there's still a mentality of 'use the right tool
for the right job'. I often do put those one-liner skills to use on a
daily basis, but evolving them into scripts intended for more than
one-off use would be considered bad form. This is true in the same way
I wouldn't write a giant sed or awk script, but I still use them daily
as handy command line tools, or as small components to some other larger
task.
Aaron S. Joyner
More information about the TriLUG
mailing list