[FM Discuss] C primer needed

Lori Nagel jastiv at yahoo.com
Tue Mar 24 18:14:35 PDT 2009


Hello, you may remember me from the Libre Planet conference when I stopped by to see what you were working on with the free software manuals. 
I noticed there were not any that pertained specifically to programming
although that is not so much just software usage. I have looked at
what is out their for beginning programmers in terms of free (as in
freedom) manuals, and I have yet to find a manual that is a C primer.
The closest thing I have found is "intro to GCC" that, while is a good
book (got me started on the basic useage of gcc and the dreaded libm.a
problem in Gnu/Linux) still does not really address much in the way of
programing since it focuses mostly on the gcc compiler rather than the
mechanics of writing programs) I have also seen some free manuals in
terms of programming books, but none that were specifically about C.
Even the ones I did see often came across as being a little bit
advanced for some beginning students. 
A primer is a sort of
pre-programing book, the kind of book you would give to someone who
didn't know anything about programming at all who suddenly decided they
wanted to modify a C program. It should be really basic.
I wrote up
a rough (incomplete) outline for the types of things that need to be included, with
the idea that the newbie, once done with it, should be able to read the
source code from any C program and go on to more advanced  C programming
books. 
1. Start by explaining why someone would want to program (basically because you found some C program you want to modify)
2. explain how to use the text editor and compiler
3. explain hello world
4.
explain the whole libm.a thing (that took me a while to figure out what
the heck a library was and why I needed to include it.)
5. functions
6.another chapter about library header files (how to include them, how to split your program into several files)
7. a chapter on passing function parameters
8.decision statements (ifs, else ifs)
9.loops
10.arrays
11. pointers
12. structs
13. unions
14. malloc and free

The
other major thing to keep in mind when doing a primer is to be witty,
that is not to make it all bland and dry and textbook like.  I had a C
primer that made it really memorable by making all the little programs
into kind of joke with a sense of humor in it. Of course if someone is going to go around being too stuffy for
that sort of thing they are probably not the sort of people who should
be programming in C anyway. 



      




More information about the Discuss mailing list