Wednesday, October 21, 2009

Debugging code

There are many ways to debug code, and some seem so primitive but are still usefull today. Ok some are not, like for example..
We used to use the border color on the old 8 bit machine to tell us what state we were in, or if something fatal happened it would change color to tell us how it got broken etc. Very useful piece of knowledge that. Of course nowadays the new machines do not have borders to color :o

What they generally do have though is configurations when building. This allows easy setting up of some debg code that could potentially slow down the game or code you are writing. But if you wrap it correctly in debug conditionals, then you will be fine. so during development you can error check just about everything without worrying about the performance loss.

I wish C# worked like the last paragraph, i would love to have the choice to error check my array bounds etc. Instead of it ALWAYS doing it for me, even when i do a full release version for the Xbox. Ahh well, it cannot be helped i guess. It seems we are too thick and need all the help we can get. BAH!

So i am also writing in Lua for the Sony Playstation. This crappy interpretive language has no good things in it as far as i can tell at the moment. It is also missing configuration directives of course. So today i came up with a waay to use debug code, and then simply have a parser that looks at the lua code and strips the debug stuff out of it if desired. Simple yet very effective, and now i can have debug again, woohoo!

Gnight

No comments:

Post a Comment