![]() |
Yeah, your old method of not styling at all and scripting like this:
PHP Code:
Or something like that.... It was very annoying and barely legible. :frown: |
Quote:
|
Quote:
:rolleyes: |
I'd do this:
PHP Code:
|
Yes this has happened to me too *sneeze*TheFox*sneezes* I just used the Servers style command
/style Type Name Like when Fox made a weapon I couldnt read I did /Style weapon -FoxTest it's not "my" style but it organizes the code. |
Quote:
|
Quote:
|
Quote:
|
Quote:
PHP Code:
PHP Code:
Hachi ... I'd be scared to see your scripting. |
Quote:
|
Quote:
|
Someone (Well, a couple) told me to change my styling so...
PHP Code:
|
I don't care what people think of my styling it's makes scripting easier for me and allows ME to read it better/quicker. But when ever I do post a snippet I usually do use the /style.
|
Quote:
-- There's more to scripting than you reading it. It needs to be legible for others too. |
Quote:
|
Quote:
|
checking "if (var == true)" is redundant unless you're not sure on the type of the variable.
|
Quote:
if ( var == 1 ) better? |
if (var) is simpler and more efficient.
when you do if (var == true) the interpreter is basically doing 2 checks. |
I see. I'll try to get used to that, though I suppose it doesn't matter that much now that I see it ^^
|
Quote:
|
Quote:
|
Quote:
And I think Stefan should make the compiler optimize if (var == true) since that looks nicer than if (var) which makes me think of the horrors of GS1. |
Except Gscipt isn't compiled it's interpreted. If it were compiled then the compiler could optimise the statement (by turning it into if (var) ) but since it's interpreted I don't think theres any way to do it.
Anyway, the difference in speed is negligible. Just use if (var == true) if it makes it easier to read. |
Everyone has their own style of coding, and they can read it. It doesn't matter if other people can't. I style similar to Skyld's styling, mainly because I find his scripts readable and he kinda pushed me to it :P
|
GScript is not interpreted, its Compiled when you save the script. Thats how scripts are sent to the client Pre-Compiled like Stefan said. Unless Stefan has a different definition of Compiled.
|
I think they are optimised a bit and compiled into byte code.
|
Its compiled into byte code, because they're all stored on your computer if you look closely enough.
Every time you add yourself a weapon, that compiled code goes directly into your computer, probably to lessen the load on the server. |
if (var) always reminded me of GS1 ... I still have nightmares about that.
|
PHP Code:
|
Quote:
The compiler could potentially optimise the code then. |
Quote:
|
I would find it annoying if I wrote
PHP Code:
PHP Code:
|
Usually the ammount of styling and the importance of a scripter's styling to himself usually reflects his skill with Graal coding.
Pretty hard to do complex scripts if you have horrible spacing ;) |
Quote:
|
I, too, think that example A looks better then example B.
A: if (var == true) { .... } B: if (var) { .... } |
Quote:
|
Quote:
PHP Code:
|
Quote:
|
Me either. The spaces inside the ( brackets offend me too ;)
Heres how I do it: PHP Code:
|
| All times are GMT +2. The time now is 04:16 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.