Jump to content

  • Log In with Google      Sign In   
  • Create Account

14 years ago on June 15th Gamedev.net was first launched! We want to thank all of you for being part of our community and hope the best years are ahead of us. Happy birthday Gamedev.net!

#Actualkrippy2k8

Posted 17 July 2012 - 07:05 PM

Nothing is inherently evil, these language features exist for a reason. It all depends on what your goals and priorities are.

As a general rule, I would avoid using static variables like that because it essentiall imposes limits on your code, and has the potential to create hard to find bugs if you don't understand the semantics of when and how static objects are created and destroyed - as few people do. If you want a clean design that doesn't box you into a corner, then stay away from statics for your data.

But if you just want to get something done quickly without burning a lot of brain cells on architecture, and using a class with a bunch of static variables gets the job done, go for it. You're not going to go to hell for it ;)

#1krippy2k8

Posted 17 July 2012 - 07:02 PM

Nothing is inherently evil, these language features exist for a reason. It all depends on what your goals and priorities are.

As a general rule, I would avoid using static variables like that because it essentiall imposes limits on your code. If you want a clean design that doesn't box you into a corner, then stay away from statics for your data.

But if you just want to get something done quickly without burning a lot of brain cells on architecture, and using a class with a bunch of static variables gets the job done, go for it. You're not going to go to hell for it ;)

PARTNERS