Originally Posted by
laserlight
One school of thought is that it is good to always use parentheses so as to avoid mistakes later, e.g.,
could be later modified by accident to be:
Code:
if (x)
foo();
bar();
when in fact this was intended:
Code:
if (x)
{
foo();
bar();
}
Placing the parentheses from the start, even when not required, may help to avoid such a mistake.
if one pays attention to details then they do not need be so rigged in using only one school of thought. put brackets around everything just to play it safe.
I am just point out how C is written to be.
Code:
Syntax
selection-statement:
if ( expression ) statement
if ( expression ) statement else statement
if ( i > 0 )
y = x / i;
else
{
x = i;
y = f( x );
}
if ( i > 0 ) /* Without braces */
if ( j > i )
x = j;
else
x = i;
if ( i > 0 )
{ /* With braces */
if ( j > i )
x = j;
}
else
x = i;
where here:
Code:
for (; left > 0; left -= newW);
for (; top > 0; top -= newH);
for (x = left; x < img.screenW; x += newW)
for (y = top; y < img.screenH; y += newH)
imlib_blend_image_onto_image (imgdata.image, 0, 0, 0, h,w, x, y, newW / space_tile_gap((rand() % 3)) , newH / space_tile_gap((rand() % 3)));
if I was to bracket my for loops then it would not render properly .
if Statement (C)