[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: OT: Server side scripting languages comparison

On Mon, Aug 19, 2002 at 02:07:12PM +1000, Donovan Baarda wrote:
> the bigest problem with perl based solutions is ...perl. Perl is great
> provided a) you already know it well, b) you never need to fix it.
> Anyone new to scripting languages should probably not start on perl if
> they can help it. 

what a load of crap.

perl is no harder to read or write than any other language....in fact,
it's considerably easier than some.  it's certainly easier to learn than
most as it's pretty forgiving of mistakes.

like any programming language, perl can be used to write beautiful code
that anyone can understand at a glance or it can be used to write
horribly obfuscated code that not even the original programmer can
understand.  that has a LOT more to do with the competence of the
programmer than it has to do with the language.  i've seen many examples
of both extremes (and everything in between) in every language i've ever
worked with.

as for the common complaint of ignorant anti-perl bigots that "perl is
executable line noise", any language looks like gobbledegook to someone
who doesn't know it....and the alleged "line noise" is just regular
expression patterns - which happen to look basically the same no matter
what language they're used in.  so that complaint boils down to "perl
makes it easy to use regular expressions for text processing".

> At first it will confuse and frustrate you, and eventualy render you
> indispensable as the only person in the company with half a chance of
> decrypting all the perl code you've written.

and the thousands upon thousands of perl programmers around the world.

and anyone with reasonable skills in pretty nearly any modern language
who is capable of reading and understanding source code.

> Not wanting to start a language war... all popular languages are good
> and vise-versa... for their particular task. Everyone should learn
> them all. I'm not convinced anything big is perls particular task...
> but quick and dirty stuff...yeah.

99% of web applications consist of quick and dirty stuff tied together
with a bit of glue code.  that's where HTML::Mason's component
architecture really shines - if you write your code well, every
component is one "quick and dirty" script or HTML page that does one
job.  the application ties them all together by calling in the
components as required.

> > if you like python, Zope is a pretty good system.  it's a lot more
> > than just a server-side scripting language, though.  it's a complete
> > integrated web application environment.  very nice if you like that
> > kind of thing.
> Python is a bit more of a pain than Perl for quick-n-dirty stuff, but
> it scales better, and I've found it much easier to learn. Zope has a
> whole extra learning curve of it's own that is probably worth it, but
> doesn't apply much to anything else.

the main problems with python are that:

a) even though it's styled a "scripting language" it isn't at all
suitable for scripting.  it's more suited to programming with a detailed
analysis and design and flowchart already done.  that's great if you're
working on a medium-large sized project....but a serious PITA if you
just want to write a little script to do something quickly.

b) spacing is syntactically significant.  this is REALLY dumb.  in perl
or C or any other reasonable language, if you want to comment out a
block of code temporarily while debugging something you just wrap it in
a construct like "if ($debug) { .... } ".  in python you have to
re-indent the block so that it knows that it's within the "if ($debug)".
the only reasonable description of that is pathologically stupid.

aside from that brain-damage, python's actually a very good language.

> > finally, PHP isn't too bad (except that in my experience it is very
> > [...]
> php is very popular for this application, so the support is good. It's
> syntax is a bit C-ish so if that's what your familiar with, it should
> be OK.

the syntax is very perl-ish, but with some significant differences.
it's far closer to perl than it is to C.

that's why i don't see much point in PHP.  why bother learning a
language that (despite what some people claim) is only suitable for web
applications when for about the same effort you can learn a general
purpose language that can be used for web applications, systems
administration, any kind of data mangling, and other general scripting

> there are a whole swag of php based site frameworks now with varying
> degrees of enthusiastic followers. Because php support is almost
> standard on most webhosting services, it is the defacto Open Source
> standard used by most projects on sourceforge etc.

just because something is popular doesn't make it any good.  for
examples, see mysql or microsoft windows.


craig sanders <cas@taz.net.au>

Fabricati Diem, PVNC.
 -- motto of the Ankh-Morpork City Watch

Reply to: