854 karma · joined January 15, 2016
But if you work with C++ in professional context, you will encounter it somewhere (library, teamate's PR, legacy code, LLM output, book / blog / conference ...). |
You actually need to know the bad stuff to be able to judge it and discard it.
Sure, none is perfect and they have cruft and warts, but they are not such a mess as C++ is.
The language keeps growing, with
- new features overlapping old features from previous standards without replacing them or deprecating them (function::copyable_function vs std::function, std::less<> key for transparent lookup in maps)
- new features not usable by the layman (coroutines ...)
- Cryptic syntax (reflection...)
- Stuff you are told not to use because of performance reason and that cant be fixed because of ABI (regex)
- Compile errors that are 1km long (no, concepts are not helping here, the 'nicer' message is still buried into a hot pile of template instantiation callstack).
- new features overlapping old features previous standards without replacing them or deprecating them. - new features not usable by the layman - ...
See function::copyable_function vs std::function, modules, coroutines, Reflection syntax is cryptic at best, ...
Not entirely true. I've heard during my uni years of a case were two independent teams used the same textbook for implementing a feature, which had an error, and thus resulting in the same failure mode.
The most helpful resource about it is a guy on stackoverflow (sehe). No idea how to get help once SO will have closed
I'm assuming that using defer would have prevented the gotos in the first case, and the bug.
- Compile it with the maximum number of warnings enabled
- Run linters/analyzers/fuzzers on it
- Ask another LLM to review it