Keyword Pairs - Indentation

Created by Microsoft, Described by waldo

Description

The if..then pair, while..do pair, and for..do pair must appear on the same line or the same level of indentation. If possible, you can align the lines it is even much more readable.

Bad code

    if (x = y) and
      (a = b) then

Good code

    if (x = y) and
       (a = b) 
    then

Discussions

You can find discussions on all “Best Practices” here.

If you don’t find the discussion of this guideline, please feel free to create a new one with the same title as this article.

Last modified February 24, 2022: Added tags & categories + cleanup (5ee04366)