Posts: 342
Threads: 34
Joined: Jun 2011
Reputation:
0
Hi,
I just have a simple question:
Why some coder stop their strings size to [256].. i use to stop mine at [300], is that why my script is sometimes unstable?
thanks
Posts: 1,059
Threads: 86
Joined: Sep 2010
Reputation:
0
I recommend string sizes 128 or lower. 300 is way too much and in-efficient for your script.
The string size means how many characters/letters are going to be in your string/message. You can always use at least [50] for small text strings, but remember: if a player's name and id with a message all appear in one string/line, I would recommend a bigger string size, like 128, not 50.
300 is useless, in-efficient and uses up a lot of computer resources.
Posts: 380
Threads: 11
Joined: Feb 2010
Reputation:
0
Obviously defining smaller string arrays will reduce memory usage. It will not change cpu usage.
To answer the original question, the number 256 is a nice round number in coding terms because it is 2 ^ 8 or
2x2x2x2x2x2x2x2 = 256
This does not make it in any way a better default size for string arrays