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
Show parent comment
-3
u/Wh00ster Apr 19 '20 edited Apr 19 '20
I'm not opposed to the arguments in your linked post. My issue is large code bases you'd see at FAANG, where you need special IDE features to see a type, which can take minutes to compile for a file and generate dependencies, or have to chase through grepping functions yourself.
This is the reality that most people have to deal with. So when a junior dev comes in and writes
auto mything = mysteriousFUnctionBuriedThroughLayersofDepsThatisActuallyAReference(), I tend to ask that dev not to useauto.I understand there are valid cases, but that's so for all C++ features. For example I wouldn't say don't use lambdas, but also don't make all functions into lambdas.