[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: const char* typedefs
- From: Dirk Laurie <dirk.laurie@...>
- Date: Tue, 6 Feb 2018 14:48:01 +0200
2018-02-06 10:05 GMT+02:00 Forrest Christian (List Account)
<lists@packetflux.com>:
> In addition, I personally find typedefs which just reiterate the type
> to be useless. If you're going to go to the bother of defining
> a type, define a type, not just an alias for a existing type.
The bigger picture matters too. The typedef adds a layer of abstraction
and of self-documentation.
For example, size_t, ptrdiff_t, etc all just define an alias, but you know
what they will be used for.
In llimits.h you find Instruction to be a typedef for unsigned either
integer or long, depending on a precompiler variable.
If Paige had chosen to emphasize that aspect, rather than the
code-golfing point of view, more people might have agreed sooner.