3 ms·
The quote is incomplete without its continuation: > This means that in order to write C++, you effectively have to memorize the undefined behavior rules, which
by throw_a_grenade 2y ago
The quote is incomplete without its continuation:
> This means that in order to write C++, you effectively have to memorize the undefined behavior rules, which sucks. Sound familiar?
Which is the point TFA is making. I believe you expended the attention span a bit too early.
- chipdart 2y ago> Which is the point TFA is making. Again, the point is wrong in more than one way. You don't simply add undefined behavior. It's wrong, and buggy code. Onboard a static code analysis tool like cppcheck to tell you when you messed up. It takes far less work to onboard any of these tools than it takes to write a sentence in a blog post.
- throw_a_grenade 2y agoTFA argues developers add it left and right, unless someone memorised all the rules. Since reportedly it's not possible to memorise all the rules by a single human, then you either "simply add undefined behaviour", or limit yourself to a subset of C++ that programmers do actually understand. Which is a solution I see in many codebases: to limit a set of permissible constructs by a style manual.