Can Novices Jump Directly in C? (Books)

uunet!bria!mike uunet!bria!mike
Sun Feb 10 04:42:21 AEST 1991


In an article, scs at adam.mit.edu writes:
>My biggest complaint with most introductory C textbooks I've seen
>is that they unabashedly explain everything in hardware terms,
>referring to "machine addresses" and "word sizes." [...]

Generally speaking, I agree with what you posted.  However, C students
do have to learn about various machine differences, and how to deal
with them.  I wouldn't say that it should be an objective in the first
couple of classes, but better sooner than later.  To write portable
code, the use of values.h and sys/types.h is essential, and shouldn't
be left as an afterthought.

One thing I have noticed in C classes is that the educator spends a
moderate amount of time on statements and order of evaluation, a _very_
long time on pointers, structures, linked lists, etc., and very little
time talking about the importance of portability.  The header files
are treated like magical black boxes.  All of the sample programs include
stdio.h, but they never explain to the student _why_ this is done.

The fact that machine differences are ignored is a Bad Thing.  The student
should know _why_ MAXINT on their IBM PC/AT is 32767 and MAXINT on their
IBM RT is 2147483647.  My feeling is that it _is_ an important aspect
of the language, and deserves equal attention.  Programmers who lean on
black box assumptions (without the foggiest notion of why what they are
doing works) are not good programmers.
-- 
Michael Stefanik                       | Opinions stated are not even my own.
Systems Engineer, Briareus Corporation | UUCP: ...!uunet!bria!mike
-------------------------------------------------------------------------------
technoignorami (tek'no-ig'no-ram`i) a group of individuals that are constantly
found to be saying things like "Well, it works on my DOS machine ..."



More information about the Comp.lang.c mailing list