[OT] The Usual Arithmetic Confusions
Paul Backus
snarwin at gmail.com
Fri Jan 28 02:15:51 UTC 2022
https://shafik.github.io/c++/2021/12/30/usual_arithmetic_confusions.html
> There are a lot of aspects of C++ that are not well understood
> and lead to all sorts of confusion. The *usual arithmetic
> conversions* and the *integral promotions* are two such
> aspects. [...] This is one of the areas in C++ that comes
> directly from C, so pretty much all of these examples applies
> to C as well as C++.
Unfortunately, this is also one of the areas of D that comes
directly from C, so D programmers have to watch out for these as
well.
It's been argued in the past, on these forums, that these
conversions are "just something you have to learn" if you want to
do system-level programming. But if C++ programmers are still
getting this stuff wrong, after all these years, perhaps the
programmers aren't the problem. Is it possible that these
implicit conversions are just too inherently error-prone for
programmers to reliably use correctly?
More information about the Digitalmars-d
mailing list