SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 25/03/2010, 04:06 PM   #1
CC.
Little Clucker
 
Join Date: May 2009
Posts: 5
Reputation: 0
Default Local vs. Global vars

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)
CC. is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can anyone tell me how to make a /Local cmd? LOCAL chat Tony_Valentino Help Archive 2 10/02/2010 02:02 AM
[REALESE][.INC] Full Global Vars V0.2 (very early realese) DeadlyCola Filterscripts 7 26/10/2009 10:14 AM
How to use vars in textdraws Zafire1410 Help Archive 6 24/08/2009 01:30 AM
I think im abusing VARS Paladin Help Archive 9 02/08/2009 08:18 PM
Global vs local string ledzep Help Archive 2 13/07/2009 11:04 AM


All times are GMT. The time now is 05:12 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.