Open paveloom opened 4 years ago
As a first pass I think:
<cond> || <statement>
is fine if it's within the line length and the statement isn't a compound statement (e.g. (...; ...; ...)
). In all other scenarios:
if !<cond>
<statement>
end
should be preferred.
Sometimes I think it is also fine for multiline compound statements if wraping them in an if
would lead to long indent.
Mostly I am thinking of testsets.
Writing something like this testset with a giant if
block around it would not be easier to read, it would just double the arond of indentation needed
That's a good counter example. There are always exceptions to rules and that would be one here. Generally though I think the first pass I outlined is what we should promote as that's generally what should be used.
A little about the stylistic usage of this functionality is mentioned in the official documentation, but I would like to see this guide's position on what and when is preferable:
or