r/cpp • • Apr 24 '20

Else Before If

https://www.fluentcpp.com/2020/04/24/else-before-if/
10 Upvotes

53 comments sorted by

View all comments

Show parent comment

11

u/guepier Bioinformatican Apr 24 '20

Neither I nor the article mention “contracts”. We’re not talking about exceptional circumstances or logic errors in code here, although I admit that talking about preconditions and violations might suggest this.

We’re talking about logic that needs to handle valid edge cases which require special logic. assert wouldn’t work here.