sl*******@yahoo .com wrote On 01/02/06 21:40,:
There's something here for all to learn. Just have humility and don't
act like a troll. The resident experts have little patience for
arrogant trolls who inisit on invoking UB.
One of C's strengths is that it's fairly easy to get
access to implementation-specific features. Initialize a
pointer with a magic integer, and you can muck with memory-
mapped hardware registers. Invoke system-specific operations
like fork() by making what seem to be perfectly ordinary
function calls. Use fdopen() to connect FILE* streams to
sockets. And so on, and so on. If C were unable to do
such things, it would never have become such an important
programming language.
A drawback of all this is that people easily lose sight
of what things are "C" and what are "C with extras." You
use the extras (because they help with what you're trying
to do), and you forget -- if you ever knew -- that they
aren't part of C. And when you can't get curses to change
font colors or you can't get a named pipe to buffer the
way you want, you take your difficulty to a C forum. After
all, these things are all declared in perfectly normal C
headers like <unistd.h> and <graphics.h>, so why should
they be any different from the things in <stdlib.h>?
And then there's another matter. We make much of the
facts that two's complement representation is not universal,
that time_t need not be a count of seconds, that auto
variables need not be allocated on a stack, and so on. But
you can write C for years and years and years and never run
into an implementation where any of these facts are apparent.
Data point: I last saw a ones' complement machine in the
mid-1970's, and haven't seen a signed-magnitude machine since
1968 (it was decimal, by the way). Data point: Every time_t
I have ever seen was a count of seconds, even if the system
actually kept time differently "under the hood." Data point:
Every C implementation I've ever seen used a stack for auto
variables (those that didn't disappear into registers). If
a person sees hundreds and hundreds of crows and all of them
are black, he can be forgiven for jumping to the conclusion
that all crows are black even if crow DNA doesn't guarantee it.
The point of all this is that ignorance is forgiveable
and should be forgiven. Newbies are not to be scorned, but to
be helped; nobody is born an expert. It can be exasperating
to correct `void main' for the skillionth time, but it is wrong
to blame a first-time offender for following the examples he
sees all about him, never knowing that they're bad examples.
Let us reserve our flamage for those who truly deserve it:
the apostates who have been told that fflush(stdin) is wrong
but who inisit [sic] on doing it anyhow, who protest that what
is true of their own machine must be true of all, and who keep
trying to pass off C-with-extras as C. Those who will not
learn are not in the same class as those who have not learned.
(I apologize for using the word "class" in c.l.c. Please
don't flame me for it.)
--
Er*********@sun .com