Code Style

Loom Code Style Guide

A day comes in every software project where code style must be documented. For Loom, today is that day.

Code style exists to make code uniform, consistent, and easy to understand. Therefore, the basic rule on code style when working Loom with is: Always match your surroundings.

C/C++

This code style document will not exhaustively cover every possibility. Please refer to The Google Code Style Guide in cases where this guide does not provide guidance.

General guidelines:

Representative C++ code:

class MyClass
{
public:

    void methodName(int param, const utString &param2)
    {
        if(param !=0)
        {
            // Do something.
        }
        else
        {
            // Do something else.
        }
    }
}

LoomScript

For LoomScript, we largely follow ActionScript 3 style. The Adobe Flex style guide is a decent starting point; please disregard the Flash/Flex specific conventions like naming movie clips and UI class prefixes!

You may also find Colin Moock's Essential ActionScript 3 helpful here.

General guidelines:

Representative LoomScript code:

package com.mycompany 
{
    public class MyClass
    {
        public function methodName(param:Number, param2:String):void
        {
            if(param !=0)
            {
                // Do something.
            }
            else
            {
                // Do something else.
            }
        }
    }   
}