Post

Early in my career I was called on to figure out what the hell was wrong with a FORTRAN program which had worked just fine for years, but when a contractor updated some formulas, it stopped working.

This post is unavailable.

They reverted to a backup and it worked, but whenever they tried to update the maths -- which were also full of weird, redundant calculations -- it stopped working again. Nobody could figure it out. It made literally zero sense. They'd change a long formula to a shorter one and everything went nuts.

Being very new and inexperienced, I took a deep breath and started at the very beginning and now you have to know something fairly specific about FORTRAN. You know in modern programming languages, your variable names are NOT ALLOWED to start with a numeral? FORTRAN doesn't have that.

What this means is that just like you can have a variable named x in C++, you can have a variable named 7 in FORTRAN. Or, in this particular case, 3. Apparently, the original programmer got tired of typing pi. But instead of defining a variable named "pi" -- well. You can guess, can't you?

No, this programmer assigned the value of pi to the integer 3. So at various points in the code he would have (1 + 2) or (4 - 1) in the maths, because when he used 3 it was pi. And nobody knew this, so they went "what the fuck is this" and corrected the weird redundant shit and the whole thing broke

So I corrected the issue by making the variable "pi" instead of "3" and then crawling through all the formulas making sure I put pi where it belonged. To this day I often solve mysterious, difficult issues by just... starting at the beginning and making no assumptions. Lesson learned.

2 reposts54 likes

No replies yet.