I have heard some thing from my lecture that I disagree. and I would like
to hear if I am wrong.
(I'll skip the others, since a number of people have already discussed
them.)
"C is an extended assembly language"
This is a matter of opinion, if not religion, but I'll weigh in on
the "no" side. The defining characteristic of an assembly language
is its direct (1-to-1, or very close) mapping to the central
processor's external machine language. (I say "external" because
many processors microdecode the "public" machine language into an
internal stream of simpler instructions.) Each statement in an
assembly language program is an (external) CPU operation, or very
nearly.
This is definitely not true of C. It may be true of some C programs
written for some C implementations, but it is not true of the
language as a whole. Yes, some C statements can be compiled into a
single assembly language statement in many implementations; this is
true for many high-level languages (COBOL has "ADD 1 TO ELEM-ITEM").
I'm not aware of any processor that has a single assembly-language
equivalent of, say,
char *NewPtr = realloc(StrList[Idx], Len1 + Len 2 + 1);
Second, aside from hypothetical exotic processors, assembly language
programs are notable for their lack of control structures: they are
formed of instruction sequences and explicit changes to the flow of
control (branches, whether they're simple, conditional, or more
complex, as with subroutine calls in some processor families). (Of
course this is a consequence of the first characteristic.) To say
that C or any language is "assembly plus control constructs" is to
say that C is "not assembly" - the lack of control constructions is
one of the most essential characteristics of (most) assembly
languages.
And, of course, standard C is abstracted from the real machine; C's
alleged "close to the metal" nature is inherently implementation-
dependent. That doesn't mean it isn't a feature of the language in
a practical sense (for most implementations), but it isn't one in
the strict sense of the language as defined by the standard.
--
Michael Wojcik (e-mail address removed)
Americans have five disadvantages which you should take into account
before giving us too hard a time:
- We're landlocked
- We're monolingual
- We have poor math and geography skills -- Lucas MacBride