Thread
: [Solved]
When should i use "static" over "new" variable?
View Single Post
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
03-04-2018 , 07:46 Re: When should i use "static" over "new" variable?
#
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.
__________________
AMXXPawn for VSCode
|
AlliedModders Dark Theme
|
Syntax Highlight for [ code ] blocks
In memory of Papa Franku
Last edited by klippy; 03-04-2018 at
07:46
.
klippy
View Public Profile
Send a private message to klippy
Find More Posts by klippy