4. Whitespace

Whitespaces (spaces, tabs, and new line characters) are allowed anywhere in the code. Proper use of whitespace does make code a lot easier to read and more pleasing to the eye.

Spaces are mandatory at the following places:

New lines are mandatory at the following places:

Use whitespaces at other places you find appropriate to maintain readability.

Do

    if (bool_flag) ...

    while (stay_in_loop) ...

    callFunction ( value1, value2 );

    list a_list = [ 1, 2, 3, 4 ];
    map a_map = $[ 1:`first, 2:`second ];
    boolean test_flag = true;

    if (test_flag)
    {
	integer one = 1;
	boolean two_flag = false;

	callFunction (one, two_flag);
    }

Don't

    if(bool_flag) ...
    while(stay_in_loop) ...
    callFunction(value1,value2);
    list a_list=[1,2,3,4];
    map a_map=$[1:`first,2:`second];


    boolean test_flag=true;
    if (test_flag){
	integer one=1;boolean two_flag=false;
	callFunction(one,two_flag);}

Some explanation to the above "Don't" example: