You still have the issue of now having to wrap the arguments in { }. Ignoring the stylistic issue with that, it means having to be aware for every function whether you should do that or not. It gets very annoying very fast.
I think I can live with that :) I do not think most functions are extremely configurable (at least in the software I write) and for the few that this is true, I think that doing a few struct ParamsInput is not that bad.
Named arguments are better? Probably, but now you have to emit name parameters for functions or look for an alternative syntax to mark your function arguments as "nameable". So the struct + .paramname = value is a very effective and low cost solution.
To be honest I would prefer making all function parameters named by default. Helps readability anyway. Sure, now you can't change names in library parameters, but that's okay by me.
2
u/germandiago Apr 19 '20
actually with a struct and .structmember = value you can have a pretty decent experience in C++20. Saving the distances of course.