Computer embarrassment
#1
Posted 2008-January-10, 10:39
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?
#2
Posted 2008-January-10, 11:45

#3
Posted 2008-January-10, 11:55
i think the same difference exists between C and fortran... or at least i hope it does. that's the bug I 'found' in some design software when i was working on a not-to-be-named large physics project as an undergrad.
#4
Posted 2008-January-10, 12:05
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.
#5
Posted 2008-January-10, 20:39
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.
#6
Posted 2008-January-10, 20:44

#7
Posted 2008-January-14, 15:23
helene_t, on Jan 10 2008, 11:39 AM, said:
Why are the most trivial bugs the most difficult to find? Or is it just that it feels so?
Because if they happen, you are usually tired.
If I encounter such an error, I know, I am 3 hours
overdue.
With kind regards
Marlowe
Uwe Gebhardt (P_Marlowe)
#8
Posted 2008-January-14, 15:56
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.
#9
Posted 2008-January-14, 16:00
I felt like I had failed 4 years of college at that point.
#10
Posted 2008-January-14, 16:04
mycroft, on Jan 14 2008, 04:56 PM, said:
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, ...
Uwe Gebhardt (P_Marlowe)
#11
Posted 2008-January-15, 02:43
To my credit I only did this once.
p
#12
Posted 2008-January-15, 08:52
mycroft, on Jan 14 2008, 04:56 PM, said:
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.
#13
Posted 2008-January-15, 10:15
Apollo81, on Jan 15 2008, 08:52 AM, said:
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.
#14
Posted 2008-January-15, 17:08
goobers, on Jan 14 2008, 05:00 PM, said:
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.
#15
Posted 2008-January-15, 17:11
jtfanclub, on Jan 16 2008, 01:08 AM, said:
goobers, on Jan 14 2008, 05:00 PM, said:
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.