[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Beginning C



On Sat, 19 Dec 1998, Chris Frost wrote:
> 
> I'd like to start learning C (I know a bit of latex and enough
> basic/newtonscript to do simple math stuff, but that's about it) and was
> wondering what a good book would be to serve as in intro to programming c
> on linux (and as an intro to programming in general).
> 

Kernighan & Ritchie will teach you C syntax but syntax is really not the
main thing you want to learn IMHO. i.e. learn programming, not C. C is
merely incidental. The classic text used in many CS 101 courses is
"Structure and Interpretation of Computer Programs." I'm sure any decent
intro to programming text would be OK though. The key is to learn about
data structures, algorithms, types, abstraction and so on. C can be
terrible without proper guidance because it has no built-in syntax to make
these things natural.  It is a very low-level language and encourages bad
habits and beginner mistakes. 

I would recommend the Gtk+ and glib source code; this is nice code that
shows how to use C well, and it will give you data structure routines to
play with. It is also fun and interesting, since windows on the screen are
always niftier than text-mode hello world programs. 

I think "Beginning Linux Programming" (Wrox Press) and "Linux Application
Development" (Addison-Wesley) are both nice books about Unix programming
with a Linux focus, but they assume you already have some C under your
belt.

Of course, part of learning to program on Linux is learning Emacs or vi,
and religiously defending your choice; and you'll probably need to know
something about make.

Havoc



Reply to: