Local vs. Global vars
#1

Which is more efficient way of coding with pawn?
1) A few global variables used throughout the whole script and as few as possible local variables.
2) Only using global vars when necessary and using a bunch of locals basically everywhere.

I'd say #2 makes more sense merely because of the meaning of words local and global. Any arguments?

Reason why I am asking, is that a friend of mine said that his server kept building up necessity for more and more memory as new players joined and played on the server and he was using local variables back then, now he switched to the solution #1 and says that the problem disappeared. I am just wondering whether that was a script related issue or a pawn one.

Elaborate in which manner do You code? (interested in what experienced pawn coders have to say)
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)