How the *** do you people come to the conclusion that it wasn't given
its name quite intentionally? Someone made a mistake, huh?
Really, it is named after the task a programmer probably wants to
accomplish by using it. That's not that hard to understand and the name
just perfectly expresses the intention.
Sure you can complain that this doesn't exactly match C language
grammar. As someone in this thread pointed out (I forgot where exactly,
this thread just got huge), there are probably historical reasons for
that. But that really really doesn't make it a misnomer. It's just an
abstract concept (defining a custom type) accomplished by some other
technique in the layer below (= language "implementation").
And so the argument continues in circles.
My claim is orthogonal to if it was purposeful or incidental by the
language writers. If incidental, then I claim that they made an
oversight. If purposeful, then I claim that they are wrong. I did not
go to the motivations of the writers or any possible mistakes on their
part, though perhaps you can draw that as an extension of my
argument.
My argument is simply that there are better possible choices of names
for "typedef" which are not as confusing if introduced from day 1.
Moreover, I claim that such a different name should have been used. I
am not trying to lay any blame.
Also, if a programmer uses typedef when he wants to define a new type,
then he's doing it wrong. He is not defining a new type. This is a
pedantic argument, but an important one. "Define a type" has a very
specific meaning w.r.t. typed programming languages. A type is defined
only when a new distinct type is introduced, and one can only talk
about distinct types w.r.t. a type checking system which distinguishes
between them, such as a compiler when doing function call argument
type checking. If a type name is introduced which is indistinguishable
from another type name w.r.t. the type checker, then no (new) type has
been defined. By that definition, "typedef" does not define types -
"typedef" does not "type-define" - "typedef" does not "typedef". Thus
it is a misnomer - the "simple meaning" taken from its constituent
words does not correctly describe the compound word.
"Sure you can complain that this doesn't exactly match C language
grammar."
Yes. That's exactly what we're doing. The C language standard is the
only relevant source of definitions in this debate. "typedef" is a
misnomer w.r.t. those definitions, so it is a misnomer.