r/cpp • • Apr 19 '20

Default function arguments are the devil

https://quuxplusone.github.io/blog/2020/04/18/default-function-arguments-are-the-devil/
92 Upvotes

149 comments sorted by

View all comments

Show parent comment

10

u/Raknarg Apr 19 '20

If there's one thing I love about Python, it's the argument handling. Being able to package around and zip/unzip collections of positional/keyword arguments is very handy and make it very easy to compartmentalize functions and form general solutions. I prefer functional style programming wherever possible and this makes it a lot smoother. Currently the only way to do it is with variadic templates which are much more limited and clunky as hell, or explicitly by passing data structures with arguments, but the data structure way tightly couples my argument lists to those types, which is annoying.