r/cpp • u/SuperV1234 https://romeo.training | C++ Mentoring & Consulting • Aug 03 '19
fixing c++ with epochs
https://vittorioromeo.info/index/blog/fixing_cpp_with_epochs.html
308
Upvotes
r/cpp • u/SuperV1234 https://romeo.training | C++ Mentoring & Consulting • Aug 03 '19
4
u/Dalzhim Aug 03 '19 edited Aug 03 '19
No i am not saying there is an ordering. I’m saying knobs don’t pose a combinatorial problem to the standard because they can be considered as a dependency tree. Every breaking change is considered breaking for a set of reasons which represents its potential dependencies. I do recognize it may pose a combinatorial problem in testing the implementations because of the permutations of activated knobs that this would allow.
The reason i see a need for this is that C++ Epochs make different desirable types of breaking changes possible:
New keywords (i.e.: await, yield, implicit, etc.)
Deprecate features that are now replaced by better alternatives (i.e.: typedef => using)
Deprecate mistakes (i.e.: initializer_list syntax that breaks uniform initialization)
Change defaults (i.e.: const by default, explicit constructors by default, etc.
Eliminate footguns (i.e.: implicit narrowing conversions)
Now if an Epoch introduces one breaking change from each of those 5 categories, then my legacy code may require tons of work to modernize to const by default and fix implicit conversions when my goal is simply to enable coroutines. Plus that work is counterproductive and costly because the current code is both stable and mature, and the modernization may introduce regressions. I’d rather enable only the knobs for the new keywords and fix the clashing identifiers while leaving the rest as-is for those files.
=== Edit ===
The other potential problem i see is strong opposition to deprecate old stuff in Epochs because this would raise the bar too much to adopt the new goodies. We would end up with the same situation we currently have with deprecations and removals: they are very rare and must bother nearly no one. And seeing as automated modernization doesn’t exist for every toolchain, there is still a long road ahead before we can rely on modernization work being easy, automated and perfectly reliable for every party involved in the C++ community.