Randal said:
cartercc> In my job, I use ColdFusion, Perl, and Java. Each language has its
cartercc> good uses and bad uses. Perl is very good for one off scripts of
cartercc> less than 25 - 50 lines. In fact, it's very, very good for that. If
cartercc> you're dealing with an application of 100 lines or more that will
cartercc> stick around for a while, I'd run like hell from Perl. (Within the
cartercc> past year, I inherited a great mass of Perl scripts, around 70 or
cartercc> so, each containing 500 or more lines of code, and it's absolutely
cartercc> not maintainable, nor maintained. As it breaks, we are rewriting in
cartercc> something else.)
It's a good thing Amazon.com and Ticketmaster haven't hired you, or the people
who worked at your company before you. Contrary to your experience, they're
finding that Perl *does* scale as well as any other language, *provided* you
treat it as a grown-up language.
For the record, the code base I inherited dates from around 1994, and
was initially written for Perl 4. It was a one man operation, who was a
tenured faculty member with his degree in EE. Tom didn't believe in
deleting code, or library routines, or modules, but believed in keeping
them all around, in most cases not even commenting the old ones out.
His revision history looks like this: 1, 2, 5, 8, 12, 14, 16, 19, 24,
25. In one case, it literally took us three weeks to discover where a
variable was initialized. It came from a module three directories over!
Tom was a bright guy and was continually learning and improving, which
meant that we had a real mix of styles and quality. He died tragically
young, and about a year later, after his code started breaking, I and
another fellow were asked to review Tom's code and fix it. We read
through it for about 12 weeks, and decided it was an impossible task,
so we started rewriting it in Java.
It's not my purpose to rate one language as 'better' than another. I'm
a database manaber for a large public university, and most days I write
some Perl. I can do some wonderful things in just a few lines of code
(as could Tom), and people use the term 'magic fingers' when talking
about our work product. That shouldn't surprise you at all.
HOWEVER, I still maintain that Java is much, much better than Perl for
a large project. The very things that Perl programmers don't like about
it, like static typing, single inheritance, access modifiers, etc.,
enforce a strictness that Perl doesn't. Additionally, Java compiles to
bytecode, and I've not had a problem running class files on different
systems. With Perl, I've found that I need to code for the target
system. Programs written for Windows will run on Linux, but some
programs written on Linux will not, repeat, not, run on Windows.
I made an analogy earilier, Java is like a deuce and a half, while Perl
is like a sports car. Perl can do things that are difficult or
(virtually) impossible in Java, and Java can do things that are
difficult or (virtually) impossible in Perl. They are different
languages, with different strengths and different weaknesses.
Personally, I find them both useful. Further, I think if you were
sitting in my chair and faced with my responsibilities, you would agree
with me.
One final note. I teach a course in OO programming. Java IMO is a
perfectly horrible language to teach programming, the reason is that it
answers questions a beginning student doesn't know to ask. Once a
student has figured out how to program, Java is a delight to use. Its
object model is structured, clear, unambiguous, and straight forward.
Perl's object model, by contrast, is a mess. Tom was beginning to use
OO Perl for the last two or three years, and I guess he was doing OJT,
but I don't even think he could remember from app to app how and why
he set some class variables. Blame the programmer (you would be
justified in doing so), but share a small part of the blame with the
language.
In fact, the number of companies looking for good Perl programmers
who *do* have a clue about maintenance has been steadily increasing
over the past few years... I'm even hearing reports that there AREN'T
ENOUGH PERL PROGRAMMERS. Go figure.
I keep an eye on dice.com. If you search for Perl, you see admin and
web jobs, but few for Perl developers in general. Search for Java, and
you get plenty of general programming results. Java jobs: 14217; Perl
jobs: 4780 - a 3 to 1 ratio.
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<
[email protected]> <URL:
http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
On a personal note, I've been a fan of yours from LP 1. This is the
first time I've had any contact with you, and I want to say that you've
done a first class job with LP and also with LPORM. Thank you for what
you've done, and may you long continue to evangelize and educate.
All the best, Charles Carter.