guard clause style static if

kdevel kdevel at vogtner.de
Sat Jul 7 11:44:13 UTC 2018


On Saturday, 7 July 2018 at 11:29:35 UTC, rikki cattermole wrote:
>>        static if (args.length == 0)
>>           return;
>
> else {
>
>> 
>>        writeln (args [0]);
>>        return bar (args [1 .. $]);
>
> }

That's not guard clause style [1][2].

[1] 
https://refactoring.com/catalog/replaceNestedConditionalWithGuardClauses.html
[2] http://wiki.c2.com/?GuardClause


More information about the Digitalmars-d-learn mailing list