Jump to content
  • Advertisement
Sign in to follow this  
Deamonslayer

Spaghetti versus masterpiece

This topic is 4446 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Im curious on finding methods to weed out spaghetti code and all other bad code. ways of doing things more efficent i've heard of single array maps are fster in memory. and globals are the devil. but i want to get better but to do so takes knowledge im wanting to know more. can ya help me out. ? Thanks! btw: talkin bout C/C++

Share this post


Link to post
Share on other sites
Advertisement
Some dot-point pointers, just to begin with.

- Read and understand the C++ FAQ Lite.

- What you want to be doing is "Refactoring". Very basically - this involves making lots of small changes while maintaining a working program.

- Unit test. This will help you with the refactoring. I highly recommend TUT as a very light-weight and capable C++ unit testing framework. You should also look into "Test Driven Development" to ensure all your new code is up-to-scratch.


Also (only slightly related) - improve your English, at very least run your posts through a spell checker. This will help you get better and more specific answers to your questions in the future.

Share this post


Link to post
Share on other sites
Is this in general, or specific to certain code? If the latter, throw up the code in question so we can give you specific pointers. If the former, then it's just a question of learning to design your code well before writing it, rethinking bad algorithms, and learning how to design your structures so they don't rely on globals. Everything in your program has its place, and learning just what that place is can only come with experience writing code. You can't learn it through generalities or from another programmer's talk - only through reading good code and writing your own, and then improving on it.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!