![]() |
#1 |
Big Clucker
![]() ![]() Join Date: Dec 2016
Posts: 138
Reputation: 0
|
![]()
Umm so is this better
pawn Code:
or pawn Code:
|
![]() |
![]() |
![]() |
#2 |
Beta Tester
![]() ![]() ![]() ![]() ![]() Join Date: Jun 2008
Location: 629 - git.io/Y
Posts: 15,725
Reputation: 3226
|
![]()
Define "better".
|
![]() |
![]() |
![]() |
#3 |
Huge Clucker
![]() ![]() ![]() Join Date: Nov 2015
Location: Romania
Posts: 260
Reputation: 5
|
![]()
I think it's the same thing, except for the second version you write less.
|
![]() |
![]() |
![]() |
#4 |
Big Clucker
![]() ![]() Join Date: Dec 2016
Posts: 138
Reputation: 0
|
![]() |
![]() |
![]() |
![]() |
#5 |
Beta Tester
![]() ![]() ![]() ![]() ![]() Join Date: Jun 2008
Location: 629 - git.io/Y
Posts: 15,725
Reputation: 3226
|
![]()
Then neither. And if you think that is what you need to worry about in code, you don't understand optimisations at all.
|
![]() |
![]() |
![]() |
#6 | |
Big Clucker
![]() ![]() Join Date: Sep 2017
Posts: 98
Reputation: 16
|
![]() Quote:
and no @IdonTmiss that's the exact same thing, just more neat in a way. If you want to use less variables you can use arrays, i.e. PHP Code:
This means that you can do something like this. PHP Code:
Very basic but you get the idea. This also does not improve optimisation, again it's just neater. Variables have such a tiny tiny impact on the server, you shouldn't worry about the amount of variables you're using tbh. |
|
![]() |
![]() |
![]() |
#7 | |
Huge Clucker
![]() ![]() ![]() Join Date: Nov 2015
Location: Romania
Posts: 260
Reputation: 5
|
![]() Quote:
I read on this community at an optimization section that tin array variables are slower. I do not know for sure whether it's true or not. |
|
![]() |
![]() |
![]() |
#8 |
Big Clucker
![]() ![]() Join Date: Sep 2017
Posts: 98
Reputation: 16
|
![]()
Like I said, you shouldn't worry about arrays/multiple variables the impact is absolutely minuscule, also like I said, it wasn't an optimisation, just more neat than using 12 different variables.
|
![]() |
![]() |
![]() |
#9 |
Beta Tester
![]() ![]() ![]() ![]() ![]() Join Date: Jun 2008
Location: 629 - git.io/Y
Posts: 15,725
Reputation: 3226
|
![]() |
![]() |
![]() |
![]() |
#10 |
Huge Clucker
![]() ![]() ![]() Join Date: Apr 2010
Location: Hamburg - Germany
Posts: 254
Reputation: 34
|
![]()
I mainly use the second method. Just looks better.
|
![]() |
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to multiple a value.. | Azzeto | Scripting Help | 3 | 07/02/2012 02:22 AM |
How to get multiple ID's? | Super_Panda | Scripting Help | 10 | 16/12/2011 02:53 AM |
Multiple uses of /set | cloudysky | Help Archive | 4 | 12/07/2011 05:33 PM |
multiple ifs | shadowdog | Help Archive | 9 | 18/01/2011 02:25 PM |
multiple servers with multiple ips on linux | yakuzza | Server Support | 2 | 09/10/2010 08:08 PM |