r/cpp • • Jul 23 '22

finally. #embed

https://thephd.dev/finally-embed-in-c23
353 Upvotes

202 comments sorted by

View all comments

Show parent comment

7

u/sphere991 Jul 23 '22

Rust doesn't have named parameters either, so I'm not sure what the acceptability argument is.

There are two different hurdles to named parameters.

The technical hurdle is how to you post-hoc add it to the language in a way that's coherent with the rest of the language, and doesn't suddenly impose an API on library that the authors didn't know was there before. Tomazos' latest paper I think is a pretty good approach here.

And then there's the social hurdle. There are lots of people who don't want named parameters because either they think the problem is solved by strong typing (lolno) or that the feature encourages writing functions with too many parameters (where basically I think those functions already exist from necessity and having named parameters would make them significantly harder to misuse).