Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Why can't life be more like Perl?

by gryphon (Abbot)
on Nov 16, 2001 at 22:04 UTC ( [id://125872]=perlmeditation: print w/replies, xml ) 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?

-gryphon
code('Perl') || die;

Replies are listed 'Best First'.
Re (tilly) 1: Why can't life be more like Perl?
by tilly (Archbishop) on Nov 16, 2001 at 23:46 UTC
    There is a good reason why Perl's design seems to "work out" better than VB's. And that reason is that all of Perl's design was understood and digested by one man (ie Larry Wall) before being spit back out on an unsuspecting world. By contrast VB is designed by committee. That means that there is no conceptual core to the language, leading to many different pieces designed independently that don't work together very well and whose interactions leave something to be desired.

    Some of the dangers of design by committee are well-illustrated by this complaint (scroll to the bottom for "Sidebar 1" to find said complaint) about the new Java IO classes:

    On the other hand, the new I/O doesn't integrate well with the old I/O. (And when exactly will it stop being new? Will Sun rename the packages when the next, newer I/O capability comes along?) In particular, the Buffers don't connect well with existing java.io classes. Just try explaining that BufferedReader can't read into Buffers and you can't pass a Buffer to BufferedWriter! The JCP operates by chartering an expert group (a committee) to address each specification request. These expert groups work independently, each with a relatively narrow charter. It is hardly surprising that there is little interaction between feature sets, or that new features do not reach broadly into the existing APIs.
    OK. That is about a different language. But the issue is the same. As Paul Graham has pointed out, any good hacker should develop a radar for what technologies they want to look into more deeply, and what they should avoid. And a lot of what goes into that radar has to do with who the language is designed for, and how. If it is designed by committee for the use of average programmers, it probably isn't going to be very fun.

    BTW, FWIW, I learned VB before Perl. While my VB is very rusty, my experience a few years ago was very similar to what you describe. For me Perl was a breath of fresh air...

      I've always enjoyed the fact that Perl was a solution to problems for which no good solution existed. I think that being driven by the desire to create a useful tool is what makes Mr. Wall's(1) contribution so special. Being the creation of an actual person (rather than a committee such as tilly described), Perl has a "personality". I think the reason that most of us here take such a shine to such a quirky language is that our personality (and, therefore, coding style and thought processes) meshes well with Perl's.

      (1) I have no right calling him by his first name (:

      ~CS

Re: Why can't life be more like Perl?
by deadkarma (Monk) on Nov 16, 2001 at 23:30 UTC
    How strange! I was thinking how perl was so much like life this morning!
    It stemmed from that TMTOWTDI attitude, perl allows you to put your own unique, natural thought process to your code. This kind of flexibility allows the language to evolvle into almost whatever it needs to be, and because the code to perl itself if open, that allows perl itself to evovle as well.
Re: Why can't life be more like Perl?
by lachoy (Parson) on Nov 17, 2001 at 00:38 UTC

    I'd also add that this tends to be an open source thing rather than just a Perl thing. Many of the tools I use started with one or two people trying to solve a problem or find a better way to do something. Along the way they created a tool many others could use, but that core consistency that tilly mentions is still there at the core.

    Chris
    M-x auto-bs-mode

Re: Why can't life be more like Perl?
by nufsaid (Beadle) on Nov 17, 2001 at 07:41 UTC
    I'll try to offer a reply that adresses your question rather than discuss VB. Mostly because I have never had the displeasure of coding in VB.

    Perhaps we could say that life is not like perl because the details of our lives are not controlled by a Saint like Larry Wall. Whatever you believe in, it is hard to deny that life is surprising, variable, unpredictible,... chaotic... In part because a great deal of a lives is determined by conflicting entities beyond our control (parents, government, bosses) who don't always see the big picture (or at least don't see it from our - the end user/developer's - point of view).

    So life resembles VB because it is born of the same chaos that committees are full of.

    But we still get to make choices independent of the committee. Sometimes we get to bring perl-like order into our surroundings. I wish we got to do more of that. Keep your courage up. Sometimes the chaos drags you to better places.

    Joe.

Re: Why can't life be more like Perl?
by Elgon (Curate) on Nov 18, 2001 at 02:49 UTC

    gryphon,

    Harsh luck on the job.

    I used to code in VB mainly for an AS-level (British public exam) project: It did actually make some sense to me believe it or not. This was mainly because I learned how to program in BASIC anyway, so certain ways of doing things tend to make more sense to me than others - don't worry I'm growing out of this. For example it took me ages to get used to such constructs as

    while (chomp <stdin>){ #foo #bar #wurble}
    even though this isn't terribly hard: The while loop was a bit of a mystery to me for a while it has to be said. Anyway, this tends to tell me that any ideas of coding tend to be a bit more relative than some of us would like to admit: There are lots of ways to do things, some of which appear totally stupid - and here's the key - but only if you've never been exposed to the alternatives. My code often appears horrendously procedural and nonidiomatic, although less so more and more, simply because I have acquired more of the style of the language over time.

    Anyway, just my two cents. I still quite like programming in VB now and then, mainly because it's like talking in baby language again.

    "A nerd is someone who knows the difference between a compiled and an interpreted language, whereas a geek is a person who can explain it cogently over a couple of beers"
           - Elgon

Re: Why can't life be more like Perl?
by Purdy (Hermit) on Nov 18, 2001 at 22:50 UTC
    Sorry to hear about your job - I had a similar situation where I lost my job earlier this year. Looking back over the experience, I can say that while it was tough for a while, it served as a betterment of my overall work/career aspect of my life, as I have found a better job position (and moved from working with M$ technologies to Open Source and specifically Perl ;-)).

    I say this only as encouragement for you (and anyone else in a similar situation) - things that don't look like they're going your way may just be short-term/temporary setbacks that will put you in a better position in the long-term.

    Jason

Re: Why can't life be more like Perl?
by Anonymous Monk on Nov 20, 2001 at 15:51 UTC
    Maybe one day life can be like Perl but when it happens we don't need becouse the life will be more and more difficult. Otherwise in these day's are guru's for importants things of life like love , money , society and sex

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://125872]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2024-04-19 17:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found