Hey guys, let me ask you a question: what do you do when you change something in the code, trying to fix something, but KNOWING FOR SURE that you'll screw up something else, but the something else doesn't get screwed up?
Do you raise your hands to the gods and say how gratefull you are that everything works OK, inspite of not making much sense to you, or you keep messing with the code trying to figure out what DID NOT go wrong?
I'm facing this situation right know but can't make up my mind on what to do. I'm really glad that everything is working well now, but it just shouldn't. I changed something that really should've messed with something else but it didn't, apparently. My fear is that it just *seems* to be working well, but will eventually blow up in my face.
What do you guys do in this kind of situation?
Opinion on general programming situation
Moderator: Moderators
Re: Opinion on general programming situation
Lol ! That never happended to me, scince I do not fix something if I know for sure that it will screw something else, so I don't go any further.tokumaru wrote:Hey guys, let me ask you a question: what do you do when you change something in the code, trying to fix something, but KNOWING FOR SURE that you'll screw up something else, but the something else doesn't get screwed up?
I think you just did something wrong when evaluate that it will screw something up, but if we could have more details, people could have more answers to tell to you.
Useless, lumbering half-wits don't scare us.
I changed it knowing (thinking!) it would screw something else up just to see if it would fix the first problem, as a test, not as a solution. But it kinda turned into a solution.
The thing is more or less like this:
There is a calculation I have to do to a value, wich is made up of other little values. It was slow, and the final value could be almost anything, so the thing could not be pre-calculated. However, the little values that can form the larger value are limited and already tabled (pre-calculated), so I decided to apply the transformation to the little values instead. This proved to be faster, since the little values are in a table, and no calculation had to be performed at all.
Applying the transformation to the little values resulted in a perfectly transformed larger value. The thing is that the little values are also used more or less as coordinates in a map. So, theorically, transforming them would screw up the use of the map, but it just didn't. I don't know why. Maybe the transformation didn't change the values as much as I thought it did. Maybe it is just not enough to confuse my map reading routine.
Not sure if this made it clearer to anyone, I was just curious as to if anyone had had a similar problem in the past and what was their reaction. I think I'll just be glad it worked out like this ang go on with this new design.
The thing is more or less like this:
There is a calculation I have to do to a value, wich is made up of other little values. It was slow, and the final value could be almost anything, so the thing could not be pre-calculated. However, the little values that can form the larger value are limited and already tabled (pre-calculated), so I decided to apply the transformation to the little values instead. This proved to be faster, since the little values are in a table, and no calculation had to be performed at all.
Applying the transformation to the little values resulted in a perfectly transformed larger value. The thing is that the little values are also used more or less as coordinates in a map. So, theorically, transforming them would screw up the use of the map, but it just didn't. I don't know why. Maybe the transformation didn't change the values as much as I thought it did. Maybe it is just not enough to confuse my map reading routine.
Not sure if this made it clearer to anyone, I was just curious as to if anyone had had a similar problem in the past and what was their reaction. I think I'll just be glad it worked out like this ang go on with this new design.
I didn't get the whole thing, but I'd recommand compare the result in both techniques, and keep the best as the definite solutiom. If the result are not what excepted (either worse or better) check why. Even if it's better. You just need to know what you're doing.
Useless, lumbering half-wits don't scare us.