Always add braces

0 minute read (72 words)

Small matter of code style that I keep coming across.

Whether to write

if (thing) Action();

or

if (thing)
  Action();

or

if (thing)
{
	Action();
}

We should always use the braces to avoid introducing bugs when modifying the code manually or through merge tools.

For the reasons behind this, read the following:


Tweet This || Post to LinkedIn || Page Source

Subscribe for updates on software development, contracting, side projects, blog posts and who knows what else. Read the archives for an idea of content.

Mailing list powered by the excellent buttondown.email.