Saturday, July 19, 2008

Goto

I feel dirty and rotten inside. Let me tell you why. Lately I have caught myself making certain "exceptions" to things that I swore I would never do.

As a perfect example, the other day I was writing a Perl script for work. Something must have come over me, and I decided that the best solution to a problem I was having was to use a "goto" statement in my code! <pause>Editor's note: Despite its appearance, this is not a nerdy post. Continue on.</pause>

Now for those of you who don't realize the implications of using a goto statement, you must understand that it is considered bad practice to use such a programming construct, as it tends to make your code complicated and unreadable. To demonstrate the seriousness of goto's, this is what can happen to you when you use one in your code:



I swore to myself that I would never use a goto all the days of my life, half from conscience and half from fear of a raptor attack. Yet there I was, typing the forbidden word into my script, ignoring the little voice inside telling me it was wrong.

I sat there, looking at my screen, glancing around to see if anyone was watching. There was no one, nothing--only the hum of the computers around me. I squeamed and twisted in my chair, wondering if I was really about to do it. It seemed like a good solution at the time, but as I tried to make it work, I discovered that I needed to add a new variable, and to make that work, I'd have to add another goto statement to balance it all out. It was turning very ugly, very fast.

It was quiet in the computer lab, and in my mind I could imagine the raptors coming down the hall, ready to devour me. Slowly, the guilt started to weigh down. It grew and grew until I couldn't stand it anymore. I just couldn't go through with it! It was wrong, and I knew it. It was wrong. There must have been another way-there must have been something else to do! I finally listened to my conscience and deleted the goto.

I ended up doing the right thing, but did I do it in time? In that same moment I looked up from my seat and saw what looked like the tip of a raptor's nose in the doorway. I instantly became dead silent. No typing, no moving, no breathing, hopeful it wouldn't notice me. The next few seconds were crucial-life or death. It sniffed...I thought it caught my scent. Ten seconds passed. Ten turned into twenty. Twenty long, long seconds.... Then it left. Clawing at the door...creak...slam...it's gone. I was safe.

I caught my breath, reflecting on my tenuous position. I had been on the edge of oblivion. Close to my own death, all because I made such a small concession in my morals and used a hated "goto" statement in my code. What would prompt me to do such a thing? What was I thinking?!? Looking back on the experience, I realize two important things: first, I didn't have the comic up on my screen to convict me of my sinfulness. I thought about looking at it, but was afraid that it would convince me to do the right thing, as it has done in the past. I didn't want that. Second, I was all alone. I thought no one would see me--it was so easy to get away with! So easy, so simple, so deadly.

The memory of it all will haunt me forever. Don't make the some mistake I did. Don't be alone when faced with temptation. Seek out help if you need it. Don't make tiny cracks in your morals, because even the smallest of cracks will widen to the point of swallowing you entirely. They will consume you, and if you are alone, you will have no one to save you.

3 comments:

Hannah Rose said...

challenging.
Thank you, Zekky.

Anthony said...

Well put my friend. Usually I abhor when people seem to try and use a bait and switch on me (not saying you did, but it sort of felt like it), but you did it well and challenged me. I am glad to have a friend like you.

denaje said...

I'm not trying to pull anything on anyone. I'm just trying to express my own frustrations in my own life (not because of goto's), and hope that it can help someone else as well.