I’ve had an analogy on my mind for several days, churning, and I
think I’d better blog it or else it’s going to devour me. Here
it is:
“PHP application development is like bologna as Perl application
development is like a good marinated London Broil.”
So, there you go. Now, let me explain. There are upsides and downsides
to this.
Balogna requires nearly nothing to start eating. It’s as simple as
opening the package, removing a slice of the processed meat product, and
eating it. It’s just that easy. My five-year old does it all the
time. Sometimes, he puts it on a plate and, using a butter knife, cuts the
slice of balogna into little wedge-shaped pieces.
And, as a consumer, you don’t have to do much to get balogna to a
point where you can consume it. It’s ready in its edible form at the
supermarket. You go, buy it, take it home, (cut a slice into little
wedge-shaped pieces), and eat it.
London Broil, on the other hand, isn’t available at the
supermarket in sealed ready-to-eat packaging. You have to find a cut of top
round beef, preferably one that has a nice amount of thickness (over 1-inch
thick is ideal). In addition to the beef, you’re going to need to get
some other ingredients for the marinade. When I was in college and wanted
to impress a girl on a date, my sister suggested preparing a dinner that
included London Broil. I don’t remember the exact recipe for the
marinade now, but I remember there was worchestershire sauce, red cooking
wine and series of different spices and salts. Looking online, there are
many different recipes for such a marinade that include honey, garlic,
chopped parsley, pepper, soy sauce, and more.
Once you get your ingredients home, mix the marinade and put it in a
large plastic bag that zips shut. Place the raw beef into the bag with the
marinade and put it in the refrigerator for up to 24 hours, turning it over
once.
Cooking the marinated London Broil is a tricky p;ocess. You definitely
broil or grill the meat, but this isn’t a hamburger. You need to
heat it carefully, about six to eight inches over the flames.
Some recipes actually call for broiling the meat to “rare”
before you place it in the marinade. After the meat is cooked to the
desired wellness, take it off the grill and begin cutting it in slices with
your knife at a 45-degree angle to the meat.
Mmmmm mmmm. This is making my mouth water, just blogging about it!
London Broil, a magnificent meal that is sure to impress a date (or
scare her away, as was my case.).
To bring this back to the programming languages, let me regurgitate a
story of a recent experience I had.
A couple of weeks ago, a handful of systems I used to manage were
compromised. These servers were running Fedora Core 6 and Fedora Core 5
which, of course, haven’t been supported by the Fedora community in at
least a couple of years. The obvious response to a compromise was to
install a actively supported Linux distribution on the hardware, make sure
security issues are addressed, and then re-deploy the applications.
I was asked to assist in the process because of my knowledge of the
systems.
Backing up critical data, installing a new OS, restoring data
was pretty straightforward and easy. Next came the harder part: Getting all
the applications configured and working again, just as they were supposed
to.
Most of these applications were written in Perl. I went through each,
one by one, taking note of the errors that occured when I first tried to
run them. These errors invariably complained of missing CPAN modules
— most of which were not available as packages available to install
from a software repository affiliated with the Linux distribution.
This meant I had to go through, one by one, and build packages for each
CPAN module that was a dependency for the applications. Many of these had
their own sets of dependencies. The result: a couple of hours building
packages to satisfy an interconnecting web of dependencies. In the end,
everything worked.
It was then I decided to check on the one application that
wasn’t written in Perl. This last application was written in
PHP by some no-name programming team that the client paid to develop and
host the software but when they didn’t have the chops to host and
manage the application, the client took the application to someone who did
have the necessary skills.
Guess what. The PHP application ran, out of the box. no unmet
dependencies; No package installations neededl No fuss; Nothing.
At a recent PLUG
meeting, I shared my experience with a friend who nodded in agreement. He
too had his share of trouble navigating the waters of “dependency
hell” trying to get a Perl application working.
Some Perl developers don’t understand this experience because they
don’t use their OS’s packaging infrastructure to manage their
Perl installation. Instead, they let Perl run loose, so to speak, and
install necessary packages outside of a package management system. The
upside: It’s fast. The downside: It’s risky and unmanagable.
My friend said, “Perl developers are just too smart.” I have
to agree. Damian Conway, a Perl guru that travelled to Utah and spoke to a
group of us about four years ago, likes to quote the late Arthur C. Clarke:
“Any sufficiently advanced technology is indistinguishable from
magic.” Conway prides himself on being the author of several CPAN
modules that work “like magic.”
Conway’s not the only one. Many in the Perl community have
developed extremely useful but complicated pieces of code and have
graciously shared it with the open source community. Like any good open
source community, others have built on what has been done and the result
is software that has a deep root system of module dependencies.
Meanwhile, Perl has fallen out of favor as a language of choice for web
application development, despite all the “magic” that exists
within the Perl community. Why? If it’s so technologically superior,
why aren’t the hordes of web developers using it?
The answer: Precisely because it is so technologically superior.
Newcomers to web development are drawn to the simplicity,
straightforwardness, and relatively painless entry of developing
applications using PHP. I can’t tell you how many PHP-based web
applications I’ve looked at that are quite useful and powerful on the
outside, but the code is... well, it’s boring. That’s not to
say the programmers didn’t know what they were doing, they just
didn’t really seem to know of any optimal ways of doing it.
In the end, that’s okay, because the software works as it’s
supposed to. A computer scientist will tell you, however, that this type of
programming runs the risk of becoming unmanagable as it grows. The PHP
community doesn’t seem to mind, though. They’ve had no problem
“brute-forcing“ their way through most obstacles like this.
As a advocate of Perl, I’m left with a problem. My language of
choice is failing at popularity contests and now I think I know why:
It’s a pain in the ass to grasp in order to wield the magic.
What is it going to take to rectify this problem?! A Linux distribution
that includes a great portion of the CPAN modules a programmer would ever
need? That would certainly make things a lot easier.
What if the great minds of Perl put their current challenges aside for a
few moments and tackled this challenge instead? Make the magic easier to
obtain. Make using Perl much less frustrating for the uninitiated.
There are some that would say selling London Broil in a ready-to-eat
package would be too hard or that it would be too expensive. I don’t
know. I know you can get some very tasty prepared, marinated meats ready to
slap on a plate. Sure, you pay more than you would for a slice of balogna,
but isn’ it worth it?