removing default case requirement?
Sebastiaan Koppe
mail at skoppe.eu
Fri Mar 31 18:40:24 UTC 2023
On Friday, 31 March 2023 at 18:30:27 UTC, Steven Schveighoffer
wrote:
> Do you feel the same about if statements without `else`? Why is
> it different?
>
> -Steve
If statements are rather binary, and it is easy to understand the
two paths.
Switches often have more than 2 cases, and its easier to forget
one.
Also consider refactoring. With switches I might add or rename or
replace one of the values, which doesn't happen with if
statements.
More information about the Digitalmars-d
mailing list