Blockland Forums > Modification Help

How to format/indent your code properly.

Pages: (1/3) > >>

elm:

Hello, I'm going to teach you how to properly format your code, using the style i prefer, Allman style (See more styles here http://en.wikipedia.org/wiki/Indent_style).

Rules
•Every bracket should have it's own line.
•Indent after each bracket.

First things first, everything inside of an open bracket, before the closing bracket should be indented (press tab once). Look at the example below.



Now, let's throw a couple more brackets in there by using an if statement.



Finally, if you ever forget how to indent, or need help, just know, indent after each bracket. Here is a little model of how indenting works.




Any questions/concerns just drop a post!


Destiny/Zack0Wack0:


--- Quote from: elm on April 18, 2012, 01:36:19 AM ---I'm going to teach you how to properly format your code, using the style i prefer

--- End quote ---
Really?

elm:


--- Quote from: Destiny/Zack0Wack0 on April 18, 2012, 02:41:14 AM ---Really?

--- End quote ---

Its probably the most used around here so yes. Im not going to go through each style obviously, you can if you want.

Wordy:

Why? I can format my code fine. People have different styles.

elm:


--- Quote from: Wordy on April 18, 2012, 02:48:17 AM ---Why? I can format my code fine. People have different styles.

--- End quote ---

This isnt for you then obviously?? Its for new scripters..

Pages: (1/3) > >>

Go to full version