Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Any debuging tips??


Lavos
 Share

Recommended Posts

Alright this just for more educational purpose I haven't taken any programming classes as of yet. I spend most of my time just learning of other peoples code and watching videos on youtube. I got the hang of most of IDE and also scanning, debugging the code, but I'm still not convinced that i know everything on the IDE just yet. If you have any tips or techniques upon debugging much easyer and quicker to share. Please do.

-Much appreciation!
Link to comment
Share on other sites

I'm not sure if I'm really using the word debbuging right. There are times when you get a error with a message and doesn't bring you to the code and most of the time crashes, I went about browsing things like this: [http://support.microsoft.com/kb/142138](http://support.microsoft.com/kb/142138)
Link to comment
Share on other sites

> I'm not sure if I'm really using the word debbuging right. There are times when you get a error with a message and doesn't bring you to the code and most of the time crashes, I went about browsing things like this: [http://support.microsoft.com/kb/142138](http://support.microsoft.com/kb/142138)

Oh right. Do you mean if your game crashes and you get something like "Runtime Error: 43"? The best thing to do is to search the forums for the same error, if that doesn't work, try Googling it and see if you can find anything.

As a last result, post a topic here and see if anyone can help you. Chances are someone has had the error before. ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png)
Link to comment
Share on other sites

> Also, hover over variables inside the errored line to see which has the error. If you hover over it long enough it will pop up with a little box saying what the contents OF the variable is. it's what i always do x3

Yeah I do that too, but i just hate it when the content for directory gets too long, shows half assed infomation and cuts it with "…" in the tipbox.
Link to comment
Share on other sites

Alright I add Watch on a variable though i still don't understand how to use this yet. I came across this [site](http://msdn.microsoft.com/en-us/library/office/ee440547%28v=office.12%29.aspx) , but didn't get any solid examples on how to use it, I still need to know how to fill in those blanks in the add watch window.
Link to comment
Share on other sites

> Do elaborate. That is the purpose of this topic after all. ![;)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/wink.png)

I didnt becouse i am not 100% sure what debugging features vb6 has.

But get really good at using breakpoints. Learn how to stop at breakpoints step to next breakpoint, step through it line by line.

pay attention to your local windows.

Get really good at the watch window. You can look at variables, you can change variables on the fly. You can call functions to some extent. It is a insanely powerful tool.

Debugging will help you a insane amount. Learn how to use it properly.
Link to comment
Share on other sites

> I rarely find myself using debugging tools, actually. Mostly because I feel that having a clear understanding of your code is probably going to be the best debugging utility available to you.
>
> Yours faithfully,
>
> S.J.R. van Schaik.

This 100%.

When I started making my game, I'd often try to load up on my ADD meds to make myself motivated and work faster. What ended up happening was that I would write HUGE piles of code, but I wouldn't have any memory of it the next morning beyond the basics. I'd then have to spend the following weekends rewriting and debugging constantly.

After I discovered the wonderful effects of caffine, I no longer need those meds to keep me going. I **_took my time_** writing everything and made an effort to understand both the big picture as well as the smaller picture. The caffine just helped me stay awake, not rushing around.

Currently, I barely ever get any crashes besides from the remaining bugs that still exist from early on in the development of the engine. I've had to rewrite things numerous times and had to take a serious look at all of my code. Basically, always work towards readability, safe coding standards, and security and you'll be safe. Never sacrifice speed for those concepts.

With that said, I like to debug the few errors I get with numerous console outputs. If I narrow the error down to one function, I'll try to output "AAA" or "BBB" in different locations to narrow it down. The majority of the time, it just ends up being a stupid mistake that I've made– nothing too bad.

**tl;dr Learn how to code safely before you do anything**
Link to comment
Share on other sites

> With that said, I like to debug the few errors I get with numerous console outputs. If I narrow the error down to one function, I'll try to output "AAA" or "BBB" in different locations to narrow it down. The majority of the time, it just ends up being a stupid mistake that I've made– nothing too bad.

That whole post was hilarious, with that being said. Learn to debug properly it will save a ton of time if that is your current method.
Link to comment
Share on other sites

> That whole post was hilarious, with that being said. Learn to debug properly it will save a ton of time if that is your current method.

I agree with Mrsh more so than I do SJR, but he (SJR) does have a point. Most beginners will forego the data management and logical flow-charting in lieu of just designing things as they go. Do both. Diagram or at least plan prior to coding AND use debugging tools to fine tune your code.
Link to comment
Share on other sites

> With that said, I like to debug the few errors I get with numerous console outputs. If I narrow the error down to one function, I'll try to output "AAA" or "BBB" in different locations to narrow it down. The majority of the time, it just ends up being a stupid mistake that I've made– nothing too bad.

You might want to consider looking into gdb and valgrind (which are irrelevant to Visual Basic 6). Additionally, the smallest mistakes usually have the most disastrous consequences.

> I agree with Mrsh more so than I do SJR, but he (SJR) does have a point. Most beginners will forego the data management and logical flow-charting in lieu of just designing things as they go. Do both. Diagram or at least plan prior to coding AND use debugging tools to fine tune your code.

The problem with most programmers is that they tend to write a lot of code in a short period of time, without testing it occasionally, whereupon they'll start fixing all the mistakes that have been pointed out by the compiler one by one. The horrible part being all the mistakes that occur at run-time (including segmentation faults for some programming languages). Therefore, it is a better idea to actually think about what your code is supposed to do, and how it will achieve that, before, whilst and even after programming, because keeping a model or image of your code base in mind will certainly help you with spotting flaws. Additionally, it is also a good idea to split up your code into smaller units, so that you can test your code more often. In the end, you'll find yourself relying on debugging tools less often, which is a good thing as debugging itself is usually more expensive than writing code. However, in those cases you'll be glad, if the hints they provide are actually useful.

Yours faithfully,

S.J.R. van Schaik.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...