Jump to content

Computer embarrassment


helene_t

Recommended Posts

So now I just spent three days looking for an apparent bug in a statistical procedure, and it turned out to be the wellknown.....

 

Lesson 1 (scientific computing for beginners): Pascal modules store matrices in major row order, while FORTRAN modules store them in major column order. Whenever you build an application of a mixture of Pascal and FORTRAN modules, make sure the matrices are transposed whenever appropriate (and not otherwise!)

 

Why are the most trivial bugs the most difficult to find? Or is it just that it feels so?

Link to comment
Share on other sites

Learning one computer language was hard enough for me. This story reaffirms my decision to avoid that sort of thing.

 

That being said maybe for you finding such a bug is a 'God I'm glad that's over... I'm so dumb' moment but I think it's pretty impressive since such a subtle difference I can only imagine is exceedingly difficult to find.

Link to comment
Share on other sites

Helene,

 

It's quite analogous to us hardware techs, troubleshooting and working for an hour, only to realize that a cable wasn't snuggly into its port thus causing the issue in the first place.

Link to comment
Share on other sites

my favourite was trying to figure out what was going on in an if check that I had written. I checked and doublechecked the logic, no dice. I even went to the trouble of deleting and rewriting the if statement, again, nothing.

 

I wrote it out on a piece of paper, and took it upstairs to another developer. I put it down in front of him and started explaining what I was doing when I realized that:

 

if (variableA = variableB) {...} is not the same, and doesn't work the same, as:

if (variableA == variableB) {...}

 

Now, I'd only been coding in C for 3 years at this point...

Apologized to my colleague for wasting his time (to which he said something I've learned to be true a number of times since: "some errors are only clear when you start explaining it to someone else, don't worry about it"), and went back to my desk.

Link to comment
Share on other sites

my favourite was trying to figure out what was going on in an if check that I had written.  I checked and doublechecked the logic, no dice.  I even went to the trouble of deleting and rewriting the if statement, again, nothing.

 

I wrote it out on a piece of paper, and took it upstairs to another developer.  I put it down in front of him and started explaining what I was doing when I realized that:

 

if (variableA = variableB)  {...} is not the same, and doesn't work the same, as:

if (variableA == variableB) {...}

 

Now, I'd only been coding in C for 3 years at this point...

Apologized to my colleague for wasting his time (to which he said something I've learned to be true a number of times since: "some errors are only clear when you start explaining it to someone else, don't worry about it"), and went back to my desk.

It nearly matches my altime favourite:

 

while(variableA == variableB); {...}

 

I was wondering, why the compiler did

execute the body only once, although it

was clear, that the statement still did hold.

And I was debbugging the stupid coding

several hours.

 

With kind regards

Marlowe

 

PS: Wonderfull language, I miss it a bit, ...

Link to comment
Share on other sites

my favourite was trying to figure out what was going on in an if check that I had written. I checked and doublechecked the logic, no dice. I even went to the trouble of deleting and rewriting the if statement, again, nothing.

 

I wrote it out on a piece of paper, and took it upstairs to another developer. I put it down in front of him and started explaining what I was doing when I realized that:

 

if (variableA = variableB) {...} is not the same, and doesn't work the same, as:

if (variableA == variableB) {...}

 

Now, I'd only been coding in C for 3 years at this point...

Apologized to my colleague for wasting his time (to which he said something I've learned to be true a number of times since: "some errors are only clear when you start explaining it to someone else, don't worry about it"), and went back to my desk.

One place I used to work had a policy that when writing comparison statements involving a variable and a constant, the constant had to go on the left.

Link to comment
Share on other sites

One place I used to work had a policy that when writing comparison statements involving a variable and a constant, the constant had to go on the left.

We didn't have that policy, but as soon as I saw the rationale somewhere, I started doing that.

 

Wouldn't have helped me that time though.

 

Michael.

Link to comment
Share on other sites

I once spent 3 hours trying to fix an error before I realized that arrays are zero indexed.

 

I felt like I had failed 4 years of college at that point.

Except when they aren't, of course....

 

Was it PASCAL that used to be the exception there? Or GWBASIC? One of them got me on that.

GWBASIC. In Pascal, index origin must be specified explicitly per array. In Basic, default is 1 but you can overwrite it globaly.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...