Anyone else do this?

Started by
5 comments, last by ichor 20 years ago
Hello all! I had just typed in a really nice (imo...hehe) post asking for some assistance with a problem I was having with vertex arrays in my octree (which, I will likely have more, so stay tuned.) Anyway, the problem I was having involved losing all my Vertex data right before creating new Octree nodes, which basically killed the entire application. However, after a good chunk of time was spent typing in my issue, I reread the message I was about to post, and I realized what the problem was. I was calling the same function twice, and, of course, everytime I called it the second time the values from the first time were gone. That''s happened to me like 3 times now in the past month or two... There I am, typing in my problem, and then suddenly, when I put my problem into concrete words and can see it from a different perspective, it goes away almost immediately. Anyone else have that happen to ''em? Just curious... =)
Advertisement
Yep, i think everyone who doesn''t draw or type his plans before executing them has these problems. It is a good idea to comment every line you code, however, this takes a lot of time and i doubt you will do it for more than 30 minutes (you will get sick of it by then ). I think writing that post is still the fastest solution.
hey Penguin! where you beeen hiding!? :D havent seeen you on msn lately.. ttyl

-- oh yeah how is your project coming along?
heh
I am always amazed how helpful it is to step away from a problem and gain additional perspective. I''ve solved dozens of seemingly intractable problems while peeing. (Programming problems, ya idjit. )

Other things that''ll often help: Describing the problem in detail to another competent programmer; adding functionality which is tangentially related to the problem you''re having; doing lots and lots of commenting, and making sure that every comment is precise and exactly correct.

"Sneftel is correct, if rather vulgar." --Flarelocke
It''s kind of funny how this latest problem of mine came out, though...

I comment quite well (not every line, but pretty close), and my overall plan of how the software should be operating is in a huge comment in each file...

The problem this time? I was testing a function, so I made a call to it from where I wouldn''t ever really call it, just so I could run the debugger and make sure it was working before going on to the next chunk of code.

Weeelllllllll.... After making sure that function worked, I forgot to take out the call to it...and still added the call to it from where it should be. I wonder if there''s a way in VS6 to have // and /* */ comments in the normal green, but make it so ////// is in red and bold.
(I even had the line commented:
////////REMOVE THIS AFTER TESTING!)

I guess there''s something to be said about _reading_ your own comments, too.
quote:
Original post by Sneftel
Other things that''ll often help: Describing the problem in detail to another competent programmer; adding functionality which is tangentially related to the problem you''re having; doing lots and lots of commenting, and making sure that every comment is precise and exactly correct.


I don''t find commenting helps much, if I have to comment I wind up rewriting to make things clearer. A few keywords like HACK, TODO and FIXME helps, just a search (or grep on a nice build platform) picks up problem areas.

However, discussing with someone you know to be competent is a godsend. Every meeting we have I''m amazed at how just having someone elses perspective on a problem makes it just dissolve away.
quote:Original post by ichor
Hello all!

I had just typed in a really nice (imo...hehe) post asking for some assistance with a problem I was having with vertex arrays in my octree (which, I will likely have more, so stay tuned.)

Anyway, the problem I was having involved losing all my Vertex data right before creating new Octree nodes, which basically killed the entire application.

However, after a good chunk of time was spent typing in my issue, I reread the message I was about to post, and I realized what the problem was. I was calling the same function twice, and, of course, everytime I called it the second time the values from the first time were gone.

That''s happened to me like 3 times now in the past month or two... There I am, typing in my problem, and then suddenly, when I put my problem into concrete words and can see it from a different perspective, it goes away almost immediately.

Anyone else have that happen to ''em? Just curious... =)


This is actually a real technique called "Confessional Debugging".... where the process of explaining the problem to someone leads you to the problem''s solution.

This topic is closed to new replies.

Advertisement