Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Goober5000 on January 14, 2003, 12:11:14 am

Title: Gah! Stupid Bugs!
Post by: Goober5000 on January 14, 2003, 12:11:14 am
I nailed that send-message bug that's been around for a while.  (It was driving me nuts.)  The problem wasn't in the messaging code at all, it was in the nameplate code... specifically, the mission parse routine that set it up.  Bobboau accidentally reset all the wingmen personas to -1, and so the routine couldn't find any valid ships.

General service announcement: To all programmers, please double-check your code.  This is the fourth bug I've fixed recently that was due to careless programming (the two beam bugs and the giant thruster glows were the other three).  For programmer sanity and to avoid wasted time, please make sure your code is bug-free before you commit it.
Title: Gah! Stupid Bugs!
Post by: RandomTiger on January 14, 2003, 06:35:16 am
The best way to identify bugs is get more than one person to look. Thats what the tester list is there for.
Title: Gah! Stupid Bugs!
Post by: kasperl on January 14, 2003, 07:45:49 am
except for one thing: don't put any bugs in. goober as a point, if the programmers commit code without testng it very, very well, the SCP will go an awfulllot slower. i know this form experience, i program in QBASIC, and i don't write my code very, clear, so i eventually end up spending my time tracking bugs instead of making a program.

:nervous: ok i'm a newbie, i'll just shut up now:nervous:

*runs*
Title: Gah! Stupid Bugs!
Post by: vyper on January 14, 2003, 08:02:03 am
Quote
Originally posted by kasperl
except for one thing: don't put any bugs in. goober as a point, if the programmers commit code without testng it very, very well, the SCP will go an awfulllot slower. i know this form experience, i program in QBASIC, and i don't write my code very, clear, so i eventually end up spending my time tracking bugs instead of making a program.

:nervous: ok i'm a newbie, i'll just shut up now:nervous:

*runs*


Indeed, if tracing problems in the scp is like tracing recursive functions then I pity Goober.
Title: Gah! Stupid Bugs!
Post by: Goober5000 on January 14, 2003, 08:06:01 am
Tracing isn't that bad - it's a pain, but it's not that bad.  But tracing doesn't always work.  I was bulldozing through the messaging code looking for that bug, and it wasn't there at all.  If I hadn't had my hunch about the persona index, I don't know how long it would have taken me to find it.

And the tester index wouldn't have helped with that - everyone knows all about the bug, but unless you're a programmer, you wouldn't be able to do anything about it.  Testers are good for finding bugs, but they usually can't do much with bugs that are already found.

I'm a little ticked off because the bug was so obvious to pick out once I pinpointed the location.  Not to pick on Bobboau, but if he had read over his nameplate parsing code once before submitting it, he would have seen that he needed to put objp->nameplate = -1, instead of objp->persona_index = -1.  Personas have nothing to do with nameplates.
Title: Gah! Stupid Bugs!
Post by: Bobboau on January 14, 2003, 10:42:28 am
the time around wich that got commited there were a lot of problems and that was the time around were we were haveing the rollback problem, I probly did some othe code had to start over backed up restarted ... gave up forgot about it... sorry
Title: Gah! Stupid Bugs!
Post by: Goober5000 on January 14, 2003, 10:50:35 am
That's okay.  This'll just serve as a heads-up to everyone submitting code, so the same thing (hopefully) won't happen again. :)
Title: Gah! Stupid Bugs!
Post by: RandomTiger on January 15, 2003, 03:05:46 am
My point is testers can be used to check programmers code before its even committed to the rest of the code. People should test more. New code can sometimes have different effects on different machines.

Stopping bugs before they happen is the best way but it would be nice to have a net for the ones that get through.
Title: Gah! Stupid Bugs!
Post by: CmdKewin on January 16, 2003, 06:01:29 am
well.. most of the time, when developping a program (even the simplest one), his spent finding and fixing bugs.. The test phase is as important as the design one. And it's usually a good idea let other people than the programers do the tests... (you know... we can grow pretty self-confident... "yes yes. My program works. It's you who isn't able to use it.")