View Single Post
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 03-04-2018 , 07:46   Re: When should i use "static" over "new" variable?
Reply With Quote #6

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.
__________________

Last edited by klippy; 03-04-2018 at 07:46.
klippy is offline