|Perl: the Markov chain saw|
Why can't life be more like Perl?by gryphon (Abbot)
|on Nov 16, 2001 at 22:04 UTC||Need Help??|
I know the title sounds rather strange, but stay with me on this. Up until Tuesday of this week, I would wake up around 6:30 AM, get dressed, and drive into the office. Once there, I'd turn on my screen (they made us turn them off at night), get a cup of "coffee," and read through my email. Thereafter, I'd typically open up a project plan or two and see where things were, figure out what I would do for the day, and go forth to code, manage, or otherwise take up space and oxygen.
Every day was slightly different, but the rhythm was always the same. Things worked. When things didn't work, I knew that it was because I did something wrong. If the "coffee" tasted strange (more so than normal, I mean), I knew it was because I didn't add the proper proportion of sugar to "coffee" liquid. If my email didn't work, it was because I had knocked out the network cable from its socket. If I was interrupted too often when I was deep in the "coding zone," I knew it was because I didn't put up my "I'm coding, leave me alone" flag. I had only myself to blame, and I liked that.
Coding in Perl is much the same way. Anyone ever tried coding an entire suite of Windows applications in Visual Basic? I have. Let me tell you: It's pure coding hell. I use these words specifically and carefully without fear of a libel suit from Bill because I know I speak the truth. Yes, indeed, you can do some rather amazing visual GUI things with VB. Working alone, I could design, develop, and implement a full-featured GUI in about a day, maybe two. That's not hell. What is hell is writing the code below the GUI, code that takes months to complete not because you're having trouble figuring out the logic or the process, but rather, because you have to look up about ever other command in the reference because nothing makes any sense. There's no uniformity outside of complete chaos. What's worse: you have to go through this hell on just about every procedure in every application, no matter how many of them you write.
By contrast, the worst Perl coding experience I ever had was when I was mostly green and tried to implement a complex data structure based on lots of random, anonymous arrays and hashes all getting wrapped up inside themselves and stored in a parent hash. This was several years ago, long before I became a member here, so I thought I had nowhere to turn for help. I must have spent hours on one data structure, mostly because I skipped the chapter on references. But even through that small, short-lived, pseudo hell (perhaps we can call it "hell light" or "heck"), I still felt grounded in the overall nature of Perl. If I needed to do a regex, find a substring, open a file, print something somewhere other than standard out, or deal with HTTP headers, the syntax made sense. The world of Perl made sense. (The reference syntax makes sense too, I just didn't know what that sense was at the time.)
My point is this: Even at its darkest, Perl makes sense at some sort of metaphysical level. When coding life is going slowly or poorly, if you're frustrated, depressed, or stuck, there are people to ask and books to consult. But the answer is almost always a, "Duh! Why didn't I think of that?" However, when coding in Visual Basic, the answer is almost always a, "Wow! No wonder I didn't think of that." While Bill would tell you my experience is really only anecdotal, I have been the victim of countless incidents where it took whole modules and hundreds of lines of VB code to do what Perl could do in half a line (40 characters) or less.
My life, up until Tuesday of this week, was like coding in Perl. When mistakes happened, when stuff didn't work right, I was the person to blame. I could debug my life or the things in it, isolate the problem, and fix it (or seek help from gurus to fix it). In the end, I could look back and say, "That made sense. I get it." On Tuesday, I lost my job; I got laid off for budgetary "reasons." I was the most qualified and experienced person in the department to do what I was hired to do. They still need to do what I was hired to do, but it's likely now that they'll never ever do it. I'll spare you the details, but I'll just say this: Working for them turned into a state of being that's not much unlike coding in VB. You'd do something that seemed totally logical, but it would produce the wrong effect. Nothing you did would work right, and you couldn't figure out why. When you looked into finding the answers, all you got back was more confusion.
So why can't life be more like coding in Perl? Why can't there be a user-group for life where people are actually interested in helping more than building up their own ego? How come I can cook two loaves of bread exactly the same way and have one turn out great but the other go flat?