jacob said:
Hi people
I have been working again in my tutorial, and I have finished the
"types" chapter. If you feel like "jacob bashing" this is the
occasion!
Jacob, your attitude verges on paranoia. And if there's
one thing I hate above all else, it's the way you paranoids
are always going out of your way to irritate ME!
I am asking for criticisms, or for things I may have said
wrong. Keep in mind that this is a tutorial, and I donot want to
overwhelm the reader with little details.
[... thoughtful essay ...]
There are a lot of minor nit-picks, but I'll ignore them
and try to look at a couple larger issues.
First, I think the notion of "type" in the essay is at odds
with C's use of the term. The essay promotes the idea that type
is a creature of the compiler, something imposed by the language
upon an undifferentiated mass of bits. While I agree that the
bits themselves may not carry type information (they do on some
systems but not on all), I'd dispute the notion that "type" is
absent from the machine language. For example, most machines
will have two (or more) ADD instructions that operate differently
on bit-for-bit identical operands: One will interpret the operands
as integers and generate an integer sum, the other will interpret
them as floating-point values and generate a different sum. This
seems to me a perfect example of "type."
Second, there seems to be a rather narrow focus on "type" as
a property of data. That's only part of the story, because in C
the expressions have types. True, those types do in some cases
derive from the declared types of variables that appear in them,
but it could be argued that the only reason for assigning a type
to a variable is to allow the compiler to do the bookkeeping to
derive the type of the expression. (This point of view leads to
a fairly straightforward explanation of why one can view a data
object in different ways by accessing it with expressions of
different types: it's not that the object itself somehow morphs
between `double' and `unsigned char[sizeof(double)]', but that the
object just sits there while expressions of different types work
on it. This approach also handles the question of the "type" of a
freshly-mallocated memory area: the memory has no "type" of its
own, but the expressions that operate on it do.) You might not wish
to take the notion quite as far as I'm suggesting, but I think it
is a mistake to limit "type" to the data objects and ignore the
expressions.
Third and finally, you write that you do not want to "overwhelm
the reader with little details," and that's fine. What, then, is
the purpose of the long list of C's types? If you are trying to
make the point that there are many types built in to C, I think it
could be made more clearly and more briefly than by exhibiting a
sterile (and incomplete!) catalog.
Looking forward to version two-dot-oh.