How do I know if my code is good?

March 27, 2009 at 15:41:14
Specs: Windows XP, AMD Athlon x2 5200+ / 2GB Kingston DDR2-800
Hello, everyone

Right now I'm working with C++ and SDL in order to create games. I just have an issue which comes up when my project starts getting more complex, I think to myself "My code sucks, I think if I'd start over and did this or that it would be better". But it never does...I mean, to code a task, any task, there are lots and lots of ways, I mean, there are so many options!
For instance, I want to create a framebuffer for SDL but I have no idea if I should use OOP, or if I should use separate functions, or if I should combine both, or if, or if, or if...
So, my question is: How can I tell if my code is good and that I should stick with it instead of writing it all over again?
I don't expect a "You should do this" kind of answer, because I am aware this could be kind of a tough question, but please do answer based on your programming experience and please do try to give me some sort of guidelines so that I get any actual game (or something) done.

Thank you in advance and best regards
~Deimos

AMD ATHLON X2 5200+ 2.6GHz
ASUS GeForce 8600GTS
ASUS M2N-E SLI MB
2xKingston 1GB DDR2 800


See More: How do I know if my code is good?

Report •


#1
March 27, 2009 at 15:46:37
The best way to test your code is to give it to someone else to look at.

If they can understand it and work out what the code is supposed to be doing then it is good. If they cant understand it and have to constantly ask why you did this or this doesn't make sense then you need to do a re-think.

Stuart


Report •

#2
March 27, 2009 at 18:17:52
Thanks for your reply, lets assume that I have no one to show my code to. What should I do in that case?

AMD ATHLON X2 5200+ 2.6GHz
ASUS GeForce 8600GTS
ASUS M2N-E SLI MB
2xKingston 1GB DDR2 800


Report •

Related Solutions


Ask Question