MCENANEY WILLIAM J wrote:

> I'm sorry to trouble you, but I'm doubting whether I can program well in C.
> If you know of any books that might help me, please suggest them.  After
> I droned on about readable code, I knew that C wasn't my problem.  I my
> poor skill was my problem.  Thanks so much.

I can't think of any specific books offhand. However, I'd like to make 
a few points.

Firstly, C is a fairly low-level language. C statements translate to
machine code in a relatively direct fashion. In order to understand
many of the things that people do in C, it's necessary to have some
degree of understanding of low-level concepts, particularly with
regard to pointers.

People who are taught C on CS courses as if it were Pascal often get
burned by not understanding concepts such as memory management, e.g. 
returning pointers to (automatic) local variables, or not copying the
contents of static buffers (e.g. those returned by functions such as
gethostbyname) before they get overwritten.

Secondly, C can be (and often is) used as a general-purpose language
for application development. Consequently, most of the things that
apply to programming generally apply to C.

All in all, being a good C programmer is a mixture of understanding:

a) computers
b) programming
c) C itself

c) is probably the least of the three requirements. K&R is only about
250 pages (and a large chunk of that is appendices), and it gives good 
(if somewhat brief) coverage of the language.

a) is pretty useful for C programming. You can write programs in C
without too much understanding of the lower levels, but you'll have
trouble understanding much of what other people write. Though not
essential, I think that having learnt assembly language first made it
much easier for me to learn C.

b) is open ended. You could dedicate your entire life to learning one
very specific topic, yet still only cover a fraction of it. A good
knowledge of standard techniques is (IMHO) indispensable. Learning
lots of different languages also helps.

Unfortunately, books which deal with core theory seem to be getting
harder to get hold of as computers become more widely used. Instead,
you get shelves upon shelves of copies of `XXX for dummies', where XXX
is some software package that will probably be consigned to history
within 5 years.

-- 
Glynn Clements <[EMAIL PROTECTED]>

Reply via email to