View Single Post
Syturi0
Veteran Member
Join Date: Aug 2014
Location: Your mom house -Portugal
Old 03-04-2018 , 07:49   Re: When should i use "static" over "new" variable?
Reply With Quote #7

Quote:
Originally Posted by KliPPy View Post
Use static for large arrays (at least like 500 or 1000 elements) unless the function declaring them is called rarely, or if you want a variable to preserve its value between function calls.
If at any time you spend at least a few seconds thinking whether you should go with static or new, just go with new, it won't matter. People are making a fuss about this as if the difference is noticeable, and also I've seen people slamming static over almost everything in their code which is just dumb.
Finally a GOOD answer.
Thank you.
Syturi0 is offline