3 ms·
If you want pragmatism, check whether something is legal before you do it.
by tom_mellior 5y ago
If you want pragmatism, check whether something is legal before you do it.
- DangitBobby 5y agoThis is addressed quite thoroughly in the thread that I linked. It is generally impossible to determine whether your code has a bug, and you cannot possibly be responsible for every bit of code that your code may happen to touch, but even if you could, mistakes and bad practices will happen. Practically speaking, it does not matter if you can find a way to displace blame onto the writer of the code. Placing blame is not how one minimizes harm. Maybe we have different definitions of pragmatism in our heads. I would also say that leaving such a common occurrence as integer overflow as undefined behavior rather than to consider that it practically always has platform as implementation specific behavior doesn't make much sense. I mean, it does always have platform specific implementation, right? Does that not exclude it from the definition of undefined behavior? Genuinely curious. The downvotes on my previous comments tell me this sort of thinking is endemic. I suddenly have more insight into the concern people have about software development as a field.