7. Blocks and Braces

There are more ways to place braces around a block than there are computer languages that use { and }. For YaST2, only two rules about braces are important:

Do

// start of file
// first brace doesn't have any indentation
{
    // 4 spaces indentation
    integer initial_index = 0;

    while (initial_index < 10)
    {
	// incremented indentation level
	initial_index = initial_index + 1;
    }

    return initial_index;
}

Don't

{integer initial_index = 0;
while (initial_index < 10){
initial_index = initial_index + 1;}
return initial_index;}