Why I'm a Programmer

You know, the last 2 days at work have been me banging my head against my desk in frustration. I’ve been chasing the same damn Javascript bug for 48 hours. I knew exactly where the code was occurring and so I danced around it chanting incantations and poking it with a stick trying to figure out why it would error.

Hunting a computer bug is a lot like hunting a real animal (or so I would imagine, since I’ve never hunted live game). You find the trail and back track to its home. You find its source and you carefully examine it from all angles to make sure you know what you’re hunting. Is this a Syntax or a typo? A malformation or what?

I spent 2 days at the thing’s door, trying to figure out what the hell I was dealing with. I looked at its tracks, I even stared the beast in the mouth and fed it cookies damnit; trying to get it to shit something useful.

Today I came in armed with a spear and a keyboard, ready to end this. One way or another, I would be victorious. The inkling of the origin of the problem came to me last night, I wondered if perhaps I was looking at the wrong place. I mean, I knew I was staring at the line that caused the error. But what if what caused the error was only showing up there? What if in truth there was something hidden that I was missing.

Sure enough, 3 hours into my day I finally found the beast’s den. I figured out the error and let out a cry of victory. I danced around the fire and swung my spear overhead. I had slain the beast. And earned nearly 2 and a half days wages in doing so.

This is why I’m a programmer. Because there are days of pain and frustration, agony and defeat. And then, that one day where the beast is slain and I stand victorious.

I am programmer. Hear me roar.

I think I’m the only programmer who doesn’t enjoy bug finding. Which may be why I tend to have very few. :cool:

Still, congratulations!

Of course, there are also the times when you spend three days looking for the elusive bug…

…and on the thrid day, your co-worker walks up, looks over your shoulder for ten seconds, and says something like “Is that the variable you meant to use there?”

Ah, yes. The hunt for the illusive bug. Not quite like the hunt for the seemingly random and “Unable to Replicate” bug, but still a worthy challenge.

It is a good day to die. :slight_smile:

I love it when the answer comes to you in your sleep. I’ve had problems that I’ve worked all day and then, after a nights sleep, I sit down at the keyboard and simply type out he correct code. Coolest feeling evar!

I’ve dreamt a couple, but most of my inspirations come either while taking the morning dump, or scrubbing in the shower.

That used to happen to me all the time when I first started. Usually with JavaScript too.

It doesn’t happen so much anymore :frowning:

But I know exactly what the OP is saying. It’s quite the victory when you fix that stupid little thing that has been holding everything up for 3 days.

I ESPECIALLY like it when it happens to me because:

  • I’m a girl
  • I didn’t go to school for this
  • I am fairly new at programming and self-taught
  • My partner, who is older, “wiser” and a guy couldn’t get it

So it’s a big moment of “Zipper, you RAWK!!!one!!” for me :slight_smile:

(congratulations on fixing your stuff btw)

I used to be a spear hunter but I grew to be the pilot of an F-18 with smart missiles. When I first started, I used to spend days trying to track things down, honing in, and making the kill. It was a big rush.

Most of the time now, people say “There is a big problem with this program. We have struggled to understand it for weeks.” I say, “Let me take a look at that. Oh! move this hear, change this, and delete this. It’s fixed. Anything else I can do for you?”

It’s very efficient but not the same degree of satisfaction.

I know - I love the feeling of getting a program to work. I can’t explain it, but that feeling of having 4 hours pass by in a blink of an eye while you’re really into coding is great.

One of my Computer Science professors used to say that programming was hours and hours of frustration for a few seconds of complete joy.

I never really realized what he meant until I spent nearly a week tearing my hair out over a bug that ended up being fixed by making a relatively trivial change to a single line of code. When I finally figured it out, I wasn’t sure if I wanted to laugh or cry.

And then there are days like this last Friday, where I fixed 6 ‘critical’ bugs in 6 different programs written in 3 different languages, in a span of just over 20 minutes.
The project manager thought I was a god.

I’m really not lookin’ to piss on your parade, but it took you 2 DAYS to consider that the error could have occured somewhere upstreream?

“upstreream”?!

Tuba, can we get a spell checker? :smack:

ronincyberpunk
Here are 2 things that might make you feel a little bit better when you are (to use your vernacular) banging your head on your desk.

  1. Javascript really bites the big one. If I said how I really felt about it, my language would be so vulgar, I’d get in trouble even if I used it in the Pit.
    Do you like how Javascript points right to the problem? :rolleyes:
    Let’s suppose you program an “onclick” button to execute a 200 line function and then you get an “object not found” error. Bascially this means that something, somewhere in those 200 lines there is some kind of error. (I’m purposely being vague because that’s the way Javascript is when it comes to “helping” you find your errors).

I remember one error that was tough for me to find and this can be easily understood even by you non-programmers out there.
I was writing the condition that
if ((a+b)<c) {function1 (or whatever)}.
SO, for test data I chose something like a=3 b=1 and c=7.
In that case a+b would be 4 and less than 7 (value of c) and so function1 should be executed. But you know what? Function1 was NOT getting “called” or executed. I kept checking to make sure of all 3 values, syntax, parentheses, etc. Finally, it dawned on me “What’s the stupidest thing Javascript can possibly do?” In this case it took the expression LITERALLY. Yes, it “thought” it was testing as if 3 + 1 < 7 meant 31 < 7
:mad: :mad: :mad:
Or to put it in more technical language, it was treating the a + b as if I were asking it to concatenate a string !!! Once I knew that, I figured I better let Javascript’s ape’s brain know that I really, really wanted to do arithmetic. So I changed it to if (a1 + b1) < c*1 {etc}
:mad: :mad: :mad:

  1. Be glad you are a programmer. I’m not. Oh, I have a website (which I won’t plug because Dopers say I overdo that). Anyway, I have written a LOT of Javascript for that website. However, I have never been able to get a job as a programmer (and I’ve been trying since 1979 AND I go back to the days of COBOL). I gave up looking years ago because I don’t have the 3 things employers want -
  2. Experience
  3. Experience and
  4. Experience
    (I don’t know how the Hell people do get to be programmers but consider yourself lucky).
    I’ve got about 7 years before I can collect Social Security and now that is my only career goal. (besides working at my current non-programming job).

Well, my post may seem somewhat angry and bitter … oh wait a minute … “they” say it’s time for my medication.
See ya. :smiley:

Congrats on finding your bug. I too have spent about 3 days backtracking thru some ancient ‘C’ code, looking for a needle in a huge haystack. I finally found an if condition that was using “&&” instead of “&” for a mask. It was written (I swear to Og) in 1999, and had lain dormant ever since.

Now I get to explain to the boss-ling that why it took so long to make a 1-character change.

Sheesh.

(but I did do the cubicle happy-dance) :slight_smile:

The program on the whole isn’t that complicated. All the Javascript is maybe 30 lines (including whitespace and brackets on their own line, so maybe more like 15 lines of actual code). So I fairly quickly found where the error was occurring.

But I’m not a big Javascript programmer. I hardly have done anything with it. But it isn’t a difficult language and the Internet is filled with resources and other people’s code for me to stare at. So I was under the assumption that there was some clause or some malformed thing that I was doing.

As for “not pissing on the parade,” you did a damn good job. Yes, it took me 2 whole days to figure this out. Believe me, when I realized the problem I felt like a moron for having taken so long, but my bosses were just relieved to have it fixed. And if the bosses are happy. I’m happy.

wolfmeister - Yeah, I’m only a programmer because I got in when I was in college. And even though I left, they’re keeping me on (under the condition that I go back as soon as I can.) Otherwise, I’d still be at the themeparks most likely. It’s easy work and very low stress. You never bring work home with you. And yes, Javascript sucks a nut.

pullin - Throw in fancy words, and wave your arms a lot. I hear that helps!

I’ve been a programmer for eighteen years, and this describes how I usually feel now after what would have been a triumph ten years ago. I should have seen that hours (or days) ago!!

That’s one of the funny things about a programming JOB. . .

You write code with errors in it. You spend time looking for the errors. Fix the errors. Bill all of the time.

You get paid MORE than if you got it right in the first place.

Of course, salaries don’t usually work that simplistically, but it’s still kind of funny when you look at it that way.

Still, I can’t count the number of times I’ve hunted for a big all day, not found it, then come in the next morning and found it in a minute. That doesn’t seem to happen as much anymore. I’m much more efficient, and experienced, in tracking down bugs. I bet that good debugger software has saved more man-hours than just about any other application ever developed.

If you write a 200 line function in any language, you deserve what you get. Functions should be short. IMHO, anything over 100 lines is almost always way too long.

There are also some really nifty javascript debuggers that would have helped you find that problem quickly.

The hard ones to debug are almost ALWAYS fixed by a trivial change to a single line of code.