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 ;)
Show differencesHistory of post edits
#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 ;)
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 ;)