5 ms·
So far I’ve used six languages to build everything from web apps to desktop applications and C++ is still by far my favourite language. It is sad that it is st
by DethNinja 4y ago
So far I’ve used six languages to build everything from web apps to desktop applications and C++ is still by far my favourite language.
It is sad that it is still haunted by prejudice due to pre-C++11 era but modern C++ is easy to learn and use, and I recommend every programmer should give it a try.
- pjmlp 4y agoThe problem is that many keep teaching C++ with code that a C compiler won't have any issues with. That is why Bjarne keeps doing those advocacy talks about best practices.
- ModernMech 4y agoThe real problem as I see it is that people think the path to safe C++ is to tell everyone "you're holding it wrong" (just use modern C++), when it fact being able to hold it wrong is regarded as a feature (C++ maintains backward compatibility) by the C++ community.
- pjmlp 4y agoBy C expats on C++ country.
- mk89 4y agoRelated 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.