News for hackers. Stuff that matters.
Re:C++20 Idioms for Parameter Packs by jandrewrogers on Tuesday February 27, 2024 @03:03PM (#39529030)
I think knowing how to write modular code is somewhat separate from the advanced "library writer" features in C++. Anyone can write clean and modular code without them, just as you could before they existed. You don't lose expressiveness per se but from a library user perspective it requires a great many more things to be explicit, writing a lot more boilerplate, and a larger API surface area that you have to learn. The new C++ features give the library writer the option of investing in more elegant, flexible, and concise expressions of modular code with little additional work but requiring stronger C++ skills to elevate the modularity in this way.

It is an ease-of-use improvement as much as a modularity improvement and provides some evolutionary pressure to design better interfaces to modular code.

Re:C++20 Idioms for Parameter Packs by foofie on Wednesday February 28, 2024 @01:42AM (#39534805)
> Anyone can write clean and modular code without them, just as you could before they existed.

I don't think so. There are multiple books dedicated to the topic of writing modular code, including books specialized in C++. Projects such as Qt are renowned for having adopted architectural traits that ensure they do not break compatibility even following a major version upgrade. I still see projects not respecting contracts and what not to put in the interface.

I think that this belief that "anyone can write clean and modular code" contrasts with reality, and suggests a certain obliviousness regarding the problem domain.

Re:C++20 Idioms for Parameter Packs by angiosperm on Wednesday February 28, 2024 @05:08PM (#39544107)
When you are designing an interface, and a new feature could make it better -- safer, faster, less convoluted -- but you fail to use it, you have produced a worse interface.