Terminating with the same keyword that introduced the block
but also:
package Example is
end Example;
or
package Example is
end;
Terminating with the name of the block, or just end
It should be:
end <introducing keyword> (<name>);
Rationale:
Lack of orthogonality confuses programmers, as they have to remember when a different syntax is used, and what that syntax is. Furthermore, it can (and in this case does) complicate parsing.
The <introducing keyword> should be mandatory, as it makes matching substantially easier, even if using advanced Regex engines. The <name> should stay optional, as it's not required for parsing, and in small code snippets is easily matched by a human, but allows for explicit naming in more complicated sources.
Ada does:
In most cases:
Terminating with the same keyword that introduced the block
but also:
or
Terminating with the name of the block, or just
end
It should be:
Rationale: Lack of orthogonality confuses programmers, as they have to remember when a different syntax is used, and what that syntax is. Furthermore, it can (and in this case does) complicate parsing.
The
<introducing keyword>
should be mandatory, as it makes matching substantially easier, even if using advanced Regex engines. The<name>
should stay optional, as it's not required for parsing, and in small code snippets is easily matched by a human, but allows for explicit naming in more complicated sources.