5 ms·
They had something like this. It was called Core Guidelines. I think it was a bit of a misnomer b/c it sounded like some glorified style guide. But it was act
by geokon 4y ago
They had something like this. It was called Core Guidelines.
I think it was a bit of a misnomer b/c it sounded like some glorified style guide. But it was actually a set of tools and helpers/wrappers that effectively made it impossible to write a lot of unsafe pre-modern C++.
For whatever reason it's never really caught on, though it looks like it's still being worked on: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines
In principle it seems to kinda strikes the right balance where the language is narrowed - it's still all valid C++ (not an entirely new thing), but not all C++ is valid under the Core Guidelines
I'll be honest - I never tried it myself so I don't know it's deficiencies. Maybe someone who's given it a good try could weight in
- kllrnohj 4y agoI reference the cpp core guidelines all the time. It's not dead at all, things like clang-tidy make references to it constantly for rationale behind recommendations. There's only a few things I'm not a fan of, mostly around mutable out parameters (I prefer pointers not refs to make it clear at the call site it's a potential mutation)
- geokon 4y agoreference as in a style-guide? Or are you actually using the guidelines support library with things like gsl::index ? I've never seen it used in the wild
- kllrnohj 4y agoI don't use the gsl, no, but I do use linters (like clang-tidy) that enforce a decent chunk of the guide. And reference like a style guide (or any documentation really), yes.
- simplotek 4y ago> but I do use linters (like clang-tidy) that enforce a decent chunk of the guide. And reference like a style guide (or any documentation really), yes. That's my experience as well. Clang-tidy, clang-format, cppcheck and Core Guidelines. I don't recall the last project I've worked that didn't used that combo.
- simplotek 4y ago> For whatever reason it's never really caught on I don't believe this is true at all. I don't recall working on a single C++ for the last half dozen years which hasn't adopted the Core Guidelines up to the code review level. Of course it's a blend of survivorship bias to claim that no project uses the Core Guidelines if you personally fail to consider it to start with.
- marssaxman 4y agoRemarkable. This is the first time I've ever heard of the "Core Guidelines". Seems like something I would be interested in; I've increasingly felt overwhelmed by the endlessly growing scope of C++, and the challenge of understanding which parts are and are not "Modern C++".