SA-MP Forums Archive
Is this wrong? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Is this wrong? (/showthread.php?tid=475264)



Is this wrong? - Mattakil - 12.11.2013

People have said my indentations make my scripts look like shit, and messy. I think it looks neater this way, and unique :P I don't get warnings on it either, so what do you guys think?

pawn Код:
CMD:mycommand(playerid, params[])
    {
    //dosomething
    }
instead of the usual way,

pawn Код:
CMD:mycommand(playerid, params[]])
{
    //dosomething
}
Is my way acceptable to you guys? Or just plain wrong?


Re: Is this wrong? - Sublime - 12.11.2013

I will test it out, just to be sure.

EDIT:
Tried out

pawn Код:
CMD:test(playerid, params[])
       {
              return 1;
       }
And it compiled fine. So, as long as the first opening/closing brackets are there, the script will compile fine


Re: Is this wrong? - Pottus - 12.11.2013

Whatever works for you.


Re: Is this wrong? - Josh Greening - 12.11.2013

Personally, I find it neater if your first set of opening/closing brackets are indented, it also makes it easier to find things if you're scrolling through the script. (Which doesn't really make a difference as most people just use [CTRL] + [F].
Another thing, although most people might not care, it is easier for people to read code/help with requests on the forums if they are indented properly.


Re: Is this wrong? - ricardo178 - 13.11.2013

That's how I do it. Who said that it was ugly the way you do it? Lol.


Re: Is this wrong? - Baltazar - 13.11.2013

My style is:

Код:
stock function_name(){
  //code
}
How do you like it?


Re: Is this wrong? - Mattakil - 13.11.2013

Quote:
Originally Posted by Baltazar
Посмотреть сообщение
My style is:

Код:
stock function_name(){
  //code
}
How do you like it?
too PHP D:


Re: Is this wrong? - Dignity - 25.12.2013

Quote:
Originally Posted by Mattakil
Посмотреть сообщение
too PHP D:
I do it that way aswell usually. (: