C Review (left handed?)

George Robbins grr at cbmvax.cbm.UUCP
Fri Jan 23 12:44:03 AEST 1987


In article <2313 at brl-adm.ARPA> Peter at adm.UUCP writes:
>I am currently finishing up a new text book on C with a colleague
>of mine...

Well, I found about a million of these piled up in comp.lang.c and tried
to resist - but - it's interesting.  Your reviewer was obviously hopeless
or in a foul and snappy mood but he indirectly does point at a few of the
lingering problems with c...these are things that come up over and over
again and send learners to the (hopefully) guru.

>"... 95% of all C programmers couldn't give you a good
>explanation of the term lvalue..."

	Well, maybe 30% couldn't get every one of the details right and
	perhaps 5% are terminally confused (check this newsgroup).

>"... Switch/case could be classified as rarely used and should be
>kept till later.

	BS here...

>"... very few C programmers know much about sizeof..."

	Well everyone knows sizeof object, but sizeof pointers, expressions
	arrays, external items, parameters and whatnot needs to be explained
	or warned about...

>"... 99%  of  all  professional C  programmers  have no idea
>what typedef is all about, couldn't care less and probably
>won't ever need it."

	Well, many of the C texts, K&R included put more stress on #define
	and leave one wondering why you have both typedef and define.
	Discussion of typedef and examples of where it pays off are needed.

>"... 99%  of  all  professional C  programmers  have no idea
>what the comma operator is all about, couldn't care less and
>probably won't ever need it."
>"... Leave the comma operator altogether. An intro book is no
>place for obscure and unmaintainable tricks..."

	More BS, but the comma would seem to have bizarre semantics to
	anyone having just escaped pascal.  Discussion should dissuade
	it's use except where it actually reduces confusion.

>"... Pointers to functions ... few C programmers understand
>them or would ever need them..."

	Clear discussion on how to declare pointers to functions and
	other complex types is needed.  K&R tries, but give someone a
	broken compiler and let them try to work it out from the book!
	This is the spot to hammer typedef home again...

>"... a C programmer never needs to know what a byte is..."

	Most programmers have picked this up by the time the try to
	learn C, so avoid the dumb analogy definitions and maybe
	discuss the relations between the char type and a byte, and
	why 8-bits isn't automatic...
-- 
George Robbins - now working for,	uucp: {ihnp4|seismo|rutgers}!cbmvax!grr
but no way officially representing	arpa: cbmvax!grr at seismo.css.GOV
Commodore, Engineering Department	fone: 215-431-9255 (only by moonlite)



More information about the Comp.lang.c mailing list