Date: Mon, 7 Jul 2025 18:29:45 +0200
On 07/07/2025 18:03, Jeremy Rifkin via Std-Proposals wrote:
> > Typing underscores
> > is not harder than any one of the dozens of punctuation marks, or
> > capital letters.
>
> Ideally you shouldn't have to type any of those for types like these
> that are used all the time.
>
> Cheers,
> Jeremy
>
Given how often standard types like char8_t, std::vector<int> are used,
and how often underscores are used in standard library identifiers, I
think that ship has sailed /long/ ago. I don't know what language you
might consider "ideal" if you are bothered by underscores, punctuation
marks and capital letters. Some kind of lower-case cobol, perhaps?
There is a solid principle that the more commonly used an identifier is,
the more convenient it should be to type - but this should not be taken
to extremes.
And for most C++ programming, you would not normally be using the
size-specific types at all. They are heavily used in very low-level
(close to the hardware) coding in drivers and embedded programming, and
they are appropriate for defining external interfaces (file structures,
network package structures, etc.). If you are using these types "all
the time" and you are not working on that kind of code, you are probably
doing something wrong.
Much better candidates for types to use often are the [u]int_least[N]_t
and [u]int_fast[N]_t types. If you are writing portable code, and you
want a local variable that can handle 32-bit values, int_fast32_t is a
logically better choice than int32_t. If you are storing lots of data
in a huge array, and your need to store unsigned 16-bit data, then
uint_least16_t is the appropriate type. These types, however, /do/
suffer from being a bit cumbersome to type, which I believe is the main
reason they are rarely used.
But I don't see a good alternative choice of names for such types.
> > Typing underscores
> > is not harder than any one of the dozens of punctuation marks, or
> > capital letters.
>
> Ideally you shouldn't have to type any of those for types like these
> that are used all the time.
>
> Cheers,
> Jeremy
>
Given how often standard types like char8_t, std::vector<int> are used,
and how often underscores are used in standard library identifiers, I
think that ship has sailed /long/ ago. I don't know what language you
might consider "ideal" if you are bothered by underscores, punctuation
marks and capital letters. Some kind of lower-case cobol, perhaps?
There is a solid principle that the more commonly used an identifier is,
the more convenient it should be to type - but this should not be taken
to extremes.
And for most C++ programming, you would not normally be using the
size-specific types at all. They are heavily used in very low-level
(close to the hardware) coding in drivers and embedded programming, and
they are appropriate for defining external interfaces (file structures,
network package structures, etc.). If you are using these types "all
the time" and you are not working on that kind of code, you are probably
doing something wrong.
Much better candidates for types to use often are the [u]int_least[N]_t
and [u]int_fast[N]_t types. If you are writing portable code, and you
want a local variable that can handle 32-bit values, int_fast32_t is a
logically better choice than int32_t. If you are storing lots of data
in a huge array, and your need to store unsigned 16-bit data, then
uint_least16_t is the appropriate type. These types, however, /do/
suffer from being a bit cumbersome to type, which I believe is the main
reason they are rarely used.
But I don't see a good alternative choice of names for such types.
Received on 2025-07-07 16:29:49