Jump to content
Sign in to follow this  
  • entries
  • comments
  • views

When will I ever learn

Sign in to follow this  


I really should know by now not to add new arguments to a function with default parameters when refactoring my code. I'm just glad I'm paranoid with my asserts. That one would have been a pain to debug if the assert hadn't caught it.

Basically I took dodecahellspawn and began seperating game logic from any SDL dependencies, one of which was SDL_GetTicks(). So for a stopgap, I added an extra parameter to functions that used SDL_GetTicks() that was the current tick count. This unfortunately included a couple of functions that took default arguments. The bugger was that when called at the very beginning of program execution, it would have a tick count of 0, so the call stack looked reasonable at first. Sure, it took me only five minutes to figure out since I am paranoid with my asserts, but that's five minutes I could have saved if I had remembered my lessons from last time.

Hopefully now that I've taken the time to write about it, it will have sunken in for next time. I doubt it, but I can still hope.
Sign in to follow this  


Recommended Comments

There are no comments to display.

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
  • 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!