Date: Mon, 14 Oct 2019 23:42:07 -0700
On Monday, 14 October 2019 20:35:00 PDT Lyberta via Std-Proposals wrote:
> The problem is that in this case beginners will probably continue to use
> float and double because they look more legit.
>
> The guidelines then become:
> Use std::[u]intN_t for integers.
> Use bool for boolean.
> Use std::byte for bytes.
> Use std::floatN for floats.
> Use charN_t for Unicode code units until better types become available.
>
> Which means that most fundamental types should be avoided in modern
> code. Do we want to live with language whose fundamental types are broken?
They are not broken. Neither int nor double are.
If you need specific format or bit-width, then you use the one with that in
the name. If you don't and you can just live with whatever size the compiler
wants to give you, use that.
> The problem is that in this case beginners will probably continue to use
> float and double because they look more legit.
>
> The guidelines then become:
> Use std::[u]intN_t for integers.
> Use bool for boolean.
> Use std::byte for bytes.
> Use std::floatN for floats.
> Use charN_t for Unicode code units until better types become available.
>
> Which means that most fundamental types should be avoided in modern
> code. Do we want to live with language whose fundamental types are broken?
They are not broken. Neither int nor double are.
If you need specific format or bit-width, then you use the one with that in
the name. If you don't and you can just live with whatever size the compiler
wants to give you, use that.
-- Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org Software Architect - Intel System Software Products
Received on 2019-10-15 01:44:23