My question is: Does the length of variable identifiers affect the file size of a distributed program? For example, would it be better to call a variable "a" instead of "PlayerSpeed" for instance? My guess is that the length doesn't matter, but I'm just curious. :)
I do not know for sure but I would guess the longer a string or a number is a file gets bigger.
For instance int Num = 123456678234767550564032
Would take more space in file than int Num = 134565767
But I am not so sure so I may be wrong.
Hope this helps.
Does the length of variable identifiers affect the file size of a distributed program?
Not in release mode, no.
In debug mode, variable names and things are retained so the debugger can work, but in the copy of the program you'll give to other people, no it won't make any difference what you name them.
In short: Don't worry about it. Name your variables/functions/classes whatever is clear. Shortening their names does not do anything for you.
TheMassiveChipmunk wrote:
I do not know for sure but I would guess the longer a string or a number is a file gets bigger.
String literals: yes (maybe)
Variable names: no
Numbers: no
By string literals I mean this:
1 2
constchar* foo = "This is longer it will take up more space";
constchar* bar = "than this one";
BUT!
It probably won't make a difference because the exe will be padded. If you compile two programs (one with each of the above strings) they'll probably come out to the exact same size.