what do you do when you don't find the error(s)

Community Forums/General Help/what do you do when you don't find the error(s)

RemiD(Posted 2016) [#1]
what do you do when you don't find the error(s) in your code ?

Hello,

Normally when i have a bug in my program, i follow these steps to determine the error(s) which cause the bug :
->i reread the part(s) of the code which are concerned and make sure that there is no error in the spelling or in the variable "type" (byte, short, integer, float, string) or i the scope (local, global) or in the calculations.
->i use debuglog to check that the flow of the program and the results of the calculations are correct
->i use 2d/3d markers to check visually that the properties of the things are correct (positions, orientations, lengths, color, alpha)
->i divide my procedure in separate smaller steps and check that each small step is correct, which allows me to identify the part which has the error(s)

But even with all of this, this time, i see in which part of my code the error most likely is, but i don't see the error because all seems correct...

What else would you do ?

Thanks,


skidracer(Posted 2016) [#2]
Describe the problem out loud to somebody, they don't even need to be a coder, but I am always surprised how often something comes to mind once I open my mouth.


AdamStrange(Posted 2016) [#3]
if all else fails. ditch it. rewrite the code that has the error from scratch.

Sometimes it is more than the logic of the code it is the approach. starting with new code helps to clear your mind


RemiD(Posted 2016) [#4]
the problem is that i have calculated 3 vectors (triangle normal normalised vector, middle outward normalised vector, projecting normalised vector) for each vertex of a flat shape (no depth on the z axis), and when i check their values using debuglog or using markers, they are correct if i position them on the vertices of the flat shape, but when i try to position them on the vertices of the carvedareas shape (same shape but slightly curved on the z axis), they do not seem correct anymore.

And after having written that, i have an idea of the cause of the problem : even if the flat shape and the carvedareas shape have the same number of vertices and triangles, they are not the same surface, and therefore the vertices indexes may be different... So i have to code a procedure to determine which vertices indexes of one surface correspond to which others vertices indexes of the other surface.
(i hope it is that)

Thanks me, :P (and thanks skidracer for the suggestion ;) )


Wiebo(Posted 2016) [#5]
if possible, talk about it, or:
write the problem down in clear text, or:"
leave it for a while and go back later.


RemiD(Posted 2016) [#6]
the cause of the error was what i described in post #4, now fixed !