Pre-Modern Perl VS Post-Modern Perl: FIGHT!
Lately we’ve seen a couple of blog posts about “pre-modern Perl.” The core idea seems to be that older Perls (say, 5.6, or perhaps even 5.005) are perfectly good for many jobs. Which, of course, they are. I’m not sure anyone ever said they weren’t.
Although the authors tend to downplay it in the comments, the articles are also leavened with a bit of ... shall we say, dislike? ... of modern Perl (or post-modern Perl, or however you want to style it). Sure, they also contain a fair amount of “hey, if that’s your thing, that’s fine for you—just leave me out of it.” But it’s hard to gloss over statements such as:
You see I don’t love “modern Perl”, in fact I kind of hate it.
On the one hand, the posts really do want to say “this is just my opinion and it’s fine for you to have a different one.” But, on the other, one can’t help but feel a little bit of resentment, just a touch of “stop messing around with my perfectly good language and trying to dress it up with your fancy OO crap.” And that’s absolutely a fair sentiment. Oh, sure, it’s all very fine for us on the other side to say “well, just don’t use those features if you don’t want to.” But that’s a naive position. As newer versions of Perl come out, we will see bug fixes, speed improvements, and new features. And it’s not like you can get the first two without the last one. And when these fellows say that, yes, they won’t use such features because they don’t care for them, but it’s very difficult to make sure the other people on their teams don’t use them—or misuse them—and then they’re stuck with maintaining them ... well, honestly, they have a point.
But that doesn’t mean I agree with these folks. Although I grant all the above points as perfectly valid, there are a couple of other points I have a problem with.
Both posts go on to talk about how there are many shops that are still using these older versions of Perl, and will be doing so for many years, and have strong, solidly built software. Again, I grant that. When I was “growing up” (as a programmer), I heard these exact same arguments ... only at that time, it was COBOL they were talking about.
When I was neophyte programmer, we all knew COBOL was a dying language. Well, all except the people actually writing COBOL. They were well-paid, well-treated, and in demand. They pointed out that you could pick up any newspaper classified section (yes, I can remember a time when looking for a job actually involved paper) and the quantity of ads for COBOL programmers outnumbered those of any other language. They pointed at all the huge firms, many of them Fortune 500 companies, who were using COBOL and had no plans to switch any time soon. They were right about all that stuff. They just forgot (or more likely just conveniently overlooked) one important fact:
No one was writing anything new in COBOL.
These guys were well-paid and well-treated because their numbers were dwindling and they were getting harder and harder to find. The job postings were increasing because people were abandoning COBOL for other languages, and also because a COBOL vacancy was such a big deal that it ended up generating 6 or 7 want ads: one for the company itself, and the rest for all the recruiters hired to try to find a competent COBOL programmer. This was 20-odd years ago, but there are still COBOL jobs out there: a quick check of the Internet (yay for no more paper!) tells me Monster has 47 and Dice has 140. And that wasn’t even trying very hard. Hell, I bet that whatever COBOL programmers there are out there are probably better paid and possibly even better treated than I am. I bet that, if you are a professional COBOL programmer at this point in history, you will have a guaranteed job for the remainder of your life, or as long as you want one, anyway.
There’s a lot to be said for that.
But I don’t really want to program in COBOL. And I don’t want to be programming in today’s equivalent of COBOL, either.
Well, that’s okay, these articles point out. They have a solution for that too:
My first car was a 1969 Red VW Beetle. The heater was busted and perpetually on. The heat came out of a vent in the floor and burned my feet. I had to stuff a big tube sock in the vent. I put in a quart of oil at every fill up too. One day I saw a VW on the road and saw that someone had smacked a Rolls Royce grill on the front. Wow! Cool! Then it hit me. Why not just buy a Rolls Royce?
Well, it’s a fun analogy, but the reason it doesn’t do anything for me is this: I think most rational people will agree that a Rolls Royce is better than a VW Beetle. Oh, sure, there are going to be those diehard Beetle fans out there that will swear they’d rather have their finicky but adorable car over the “too slick” Rolls any day, but I think most people can agree that there are very few real-world situations where the VW is going to be a better choice.
But, when it comes to programming, the reason I don’t switch from Perl to a better language is that I haven’t found one yet.
insert into companies %company or maybe
@ids = select id from departments where name in @dept_list), I would jump on those in a heartbeat. I don’t hate other languages. I just love Perl.
So my Perl has to keep on growing, keep on evolving. As with so many things in life, it’s evolve or die, and I’d prefer it not die. As a programmer (indeed, as a human being), I am constantly evolving, constantly learning, constantly trying new things, constantly looking back on what I did last year and last decade with chagrin, proud that I now know better, happy to be using new techniques, knowing that there are still new things out there that I don’t understand yet—aspect-oriented programming, or inversion of control, or behaviour-driven development—and that maybe those things are passing fads or maybe I’ll suddenly have a light-bulb pop on over my head when I reread them for the thirteenth time and I’ll add them to my toolbox and my software will be that much more elegant, that much more uncluttered, ever so slightly easier to comprehend and maintain. So Perl better keep up, or I’m going to outgrow it. And I don’t want to outgrow it. It’s the best companion I’ve found so far.
Maybe this can help some of you “pre-modern Perl” fans out there see why some of us “post-modern Perl” fans want to see even more “crazy” shit glommed onto our favorite kitchen sink language. Because, in the end, it isn’t that crazy. In some cases we just need to Perl to keep up with us. And, if that means that in other cases it’s going to drag us along for the ride, I’m okay with that.