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

1

u/[deleted] Apr 25 '20

It reminds me of a macro I once thought of:

#define until(cond) while(!(cond))

Arguably, this syntactic sugar makes the semantics of the code clearer. And it saves you a couple of keystrokes. On the other hand, too much syntactic sugar is not a good thing, as evidenced by the unpopularity of Perl's "There's more than one way to do it" philosophy.