[thelist] Re: Perl vs other tech

Kelly Hallman khallman at wrack.org
Tue Nov 12 15:38:01 CST 2002


On Tue, 12 Nov 2002, Benjamin wrote:
> When I was first getting started I looking into PHP (then in version 3) and
> Perl.  I chose Perl for multiple reasons, namely that I had a friend who is
> a guru and could mentor me with it.

perl was the first language I gained any proficiency in.  I still love it
and use it on a regular basis, but not for everything.

> The other main reason was that php seemed sloppy in that I've had to
> clean up way too much code where it was impossible to find out wtf was
> going on because you ddon't have to declare variables.

It's funny that you should mention this, because I think that both PHP and
perl can be ugly or beautiful depending largely on the coder's style.
Same goes for the "figuring out what is going on" factor.  To any non-perl
programmer something like $t =~ s/\/\/:\\\\/xyz/ig; is going to look like
nothing!  For the record, this is not a flame war, but a discussion! :)

It really depends on what you are doing.  A very lot can be done in 1-5
lines of perl code that would take 30+ lines of code in other languages.
On the other hand, try to replicate PHP's sessions support in perl and you
will be there for days.  There are many such examples for both sides.

> Add in tons of pre-made modules .. still the best hands down

In the end, unless you are opposed to using more than one language, I
think it's hard to argue perl over PHP for web development (in most
situations, again right tool/job).  Also hard to argue PHP over perl for
anything but web development.

> The odd thing is that you can write scripts/apps [in perl] that look
> just like a winblows batch file or a very in depth C application.  It's
> all up to the programmer.

I think the same could be said about PHP... you can write spaghetti code
into your HTML or you could design an entire web application in OOP that
generates it's own code.  By the way, I think PHP has much cleaner OOP
syntax and organization than perl's, which seems like an afterthought
(which I believe it was).

For larger coding projects I actually prefer python to perl.  python code
is necessarily beautiful!  python taught me so much about programming.

--
Kelly Hallman
http://wrack.org/




More information about the thelist mailing list