3 ms·
Related to this, maybe: an issue I had was also the fact that online many of the help pages are really outdated. I can't forget an old accepted "much voted" an
by mk89 4y ago
Related to this, maybe: an issue I had was also the fact that online many of the help pages are really outdated.
I can't forget an old accepted "much voted" answer I saw on stackoverflow which claimed that raw pointers should be owning resources, because that's how the language always did.
I think the answer was dated like 2008 or so, can't find the reference anymore. That's when I started to pay a lot more attention to the published date whenever I search for help and I stumble upon a very old article. If only we could get rid of old resources written before maybe 2018-2019 and only select those that are still "modern", that'd be already a great step forward.
Luckily we have this now [0].
They should invest more in tools like the GSL extension at least as a clang warning which really helps, and things like that. That's how I believe Java was also able to modernize. You can write pretty crappy Java too, but tools like findBugs or checkstyle do help, so why not!
[0]: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#r3-a-raw-pointer-a-t-is-non-owning https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines...
- pjmlp 4y agoThat is what using VC++ with integrated support for Core Guidelines feels like, naturally that is a minority. https://learn.microsoft.com/en-us/events/pure-virtual-cpp-2022/everything-i-learned-about-static-analysis-and-program-safety-in-cpp https://learn.microsoft.com/en-us/events/pure-virtual-cpp-20...
- mk89 4y agoYeah, I kind of envy that. Although with Clang-tidy I sometimes see GSL warnings: https://clang.llvm.org/extra/clang-tidy/ https://clang.llvm.org/extra/clang-tidy/ which is pretty cool - I wonder how up-to-date that is compared to the GSL extension. The more you invest in this kind of automated tools, the earlier you catch such bugs. Sure, sometimes it's "false positives, I know what I am doing", but you cut maybe a good > 90% of crap that comes from just writing old-style code.