quartz/content/if statements.md
2024-04-16 19:30:00 +02:00

742 B

When implementing an if statement that includes a single-statement code block, Microsoft recommends that you consider these conventions:

  • Never use single-line form (for example: if (flag) Console.WriteLine(flag);
  • Using braces is always accepted, and required if any block of an if/else if/.../else compound statement uses braces or if a single statement body spans multiple lines.
  • Braces may be omitted only if the body of every block associated with an if/else if/.../else compound statement is placed on a single line.

Exercise - Remove code blocks from if statements - Training | Microsoft Learn

202404161912