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
4
u/fransinvodka Apr 19 '20
Everytime named arguments come into discussion, I remember the API of Python's scikit-learn library. Some constructors have tons of default arguments (that you can't really avoid), but you usually don't have any issue with it, as you have named arguments.
You can't provide such a clear and elegant API in C++, and I think that's why many libraries implement the core in C++ and provide a Python API