Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] Perl splitting help


>I challenge lovers of Perl. What is your reason for using Perl
>instead of (say) Python? If your primary reason is that you
>know Perl, are used to it, and would find it too hard to learn
>another language, well haven't we heard that about a particular
>popular OS?
>
>(Ken happens to know a bit of Python, so I am really interested
>in his comments here)

When you look at the facilities provided by Perl and Python, they are of
roughly equal power. However the languages have different design
philosophies. Guido believes that "There is only one obvious way to do
it" whereas Larry believes that "There is more than one way to do it".
So it's really a matter of taste which one suits your personality
better. I feel I'm quite capable of structuring the code legibly myself
and I don't need this to be enforced by the language. IMO, complaining
that Perl allows shorthand for commonly used idioms, like knowing that
the default target of a split is $_ is like complaining that people say
"it's" instead of "it is". You can see Guido's scientific background and
Larry's liberal arts background here.

So in short, if you want things to be uniform and to have hard and fast
rules that are easy to remember, perhaps Python is for you. However if
you like a bit of lattitude and have no difficulty with idioms, whether
in computer or natural languages, Perl may be to your taste.

Above all, I believe in the right algorithm. No amount of syntactic
sugar or language regulations will save a badly designed algorithm.