r/cpp • u/anonymous23874 • Apr 19 '20
Default function arguments are the devil
https://quuxplusone.github.io/blog/2020/04/18/default-function-arguments-are-the-devil/
90
Upvotes
r/cpp • u/anonymous23874 • Apr 19 '20
View all comments
45
u/whattapancake Apr 19 '20
Just sounds like a case of throwing the baby out with the bath water to me. Of course there are downsides to certain language features - in fact, C++ is chock full of footguns much worse than those the author points out about default arguments. That doesn't mean we should avoid these features like the plague, but rather use them modestly and only when appropriate.