Posts: 121
Threads: 29
Joined: Feb 2008
Reputation:
0
When I script, I indent normally, but write commands on "less lines" than normal. I don't give brackets their own line, I put them after the if, function, for, etc. in front of them.
Anyways, I tend to cram my code a bit tighter than most, will this result in reduced performance, or will it simply look bad(in most's opinion). Thank you.
Posts: 190
Threads: 17
Joined: Jul 2010
Reputation:
0
I would like to know this too, will it run slower or faster ? :/
I don't think there is a difference, since coding both(the messy one and good one) will be the same thing
Posts: 1,363
Threads: 14
Joined: Apr 2009
Reputation:
0
well afaik when it compiles no matter how you had your brackets positioned you'll have the same result. I like to keep mine neat like
if (x == y)
{
stuff
more stuff
return 1;
}
but if it's just 1 line of things then I won't even open brackets like
if (x == y) return SendClientMessage(asdfwef,wafeaw,gder);
Posts: 2,896
Threads: 11
Joined: Sep 2008
Reputation:
0
No, it won't reduce performance if you cram it all together.
Posts: 297
Threads: 47
Joined: Jun 2008
Reputation:
0
like in every (as far as I know) scripting / coding language, spaces and tabs are no more then visual support to read the code. When the script is put to use, whitespace is not interpreted
Posts: 2,421
Threads: 52
Joined: Mar 2009
Reputation:
0
16.07.2010, 15:27
(
Последний раз редактировалось iggy1; 16.07.2010 в 15:28.
Причина: typo
)
For some reason i don't follow a certain style (not best idea) but i think its best to keep it spaced out so you can find/fix bugs or update faster.
I do beleive most (if not all compilers) ignore any spaces at compile time so it shouldn't make a difference to the performance of the compiled script no matter your scrpting style.