Muli Ben-Yehuda's journal

April 19, 2004

agenda for a one day c programming class

Filed under: Uncategorized — Muli Ben-Yehuda @ 12:31 PM

I will be giving a one day class later this week on C programming. The
audience is people who have had some programming experience, but not
necessarily in C. I just started preparing it, and here’s my tentative
agenda. Comments will be appreciated, especially on possible
exercises. Note that There’s tons of stuff missing, but it’s only a
one day class…

  • one hour introduction (0900-0950): origins of c, why learn c, hello
    world, compiling with gcc on linux

  • one hour syntax of c(1000-1050)
  • exercise(1100-1150): small (100 line) program in c, contents TBD.
  • 1200-1300: lunch break
  • pointers and dynamic memory allocations(1300-1350)
  • structures, ADT(Abstract Data Types) and OOP in c(1400-1450)
  • exercise(1500-1600): write a program that will use dynamic memory,
    adt, oop (menu driven user interaction? interactive game?)

  • different aspects of c(1600-1650) c the standard, cross platform
    c, c as portable assembler, c as an interface to the operating system,
    libraries, posix, kernel.

Stuff I won’t be talking about: general programming, debugging,
profiling, optimizing, macros, kernel hacking =)

Advertisements

16 Comments »

  1. I think macros are a generally-useful topic to talk about in C.
    I mean, how will they feel if they see something like this:
    #define max(a, b) ((a > b) ? a : b)
    and they can’t understand it?
    Do whatever you wish, but this is my personal opinion.

    Comment by diego001 — April 19, 2004 @ 3:55 AM | Reply

    • hehe macros are evil.

      Comment by ideawerkz — April 19, 2004 @ 3:57 AM | Reply

      • Hee… This is the feeling among most programmers I know.
        But that doesn’t mean that they shouldn’t be taught.

        Comment by diego001 — April 19, 2004 @ 3:58 AM

      • Correct. Though less important compared to pointers 🙂

        Comment by ideawerkz — April 19, 2004 @ 4:02 AM

      • True enough.

        Comment by diego001 — April 19, 2004 @ 6:09 AM

    • I’ll mention them, and maybe even show an example or two, but mostly from the “don’t do it” angle.

      Comment by mulix — April 19, 2004 @ 7:33 AM | Reply

  2. Grounds up …
    I tried a lecture series teaching C grounds up starting from assembly
    operations and building up to C. It gives a better perspective but
    might not be possible in a one-day workshop.
    Best of luck! DO let me know how it goes…

    Comment by jnagal — April 19, 2004 @ 4:01 AM | Reply

    • Re: Grounds up …
      do you, by any chance, still have that link to the lecture series?
      I enjoy reading your journal. Might if I add you?
      btw, what does your sign mean?

      Comment by ideawerkz — April 19, 2004 @ 4:03 AM | Reply

      • Re: Grounds up …
        > do you, by any chance, still have that link to the lecture series?
        I don’t have the lecture notes, there were just some slides and mostly
        board and chalk show. But there is a book on Programming from grounds up somewhere in linux doc site. I have a pdf of that if you want.
        > I enjoy reading your journal. Might if I add you?
        sure, go ahead.
        > btw, what does your sign mean?
        Its from a book called cryptonomicon by Neal Stephenson
        From the authour’s FAQ:
        |> Neal, what is that symbol on the cover of Cryptonomicon?
        |
        |It is one of several symbols that were used, long ago, as a kind of |shorthand by alchemists, to denote gold. I provided the publisher’s |art department with several such symbols and they happened to choose |that one, presumably because it looked the coolest.

        Comment by jnagal — April 19, 2004 @ 4:13 AM

      • Re: Grounds up …
        1) sure. perhaps you can mail it to amnesia%anomalistic!.org. Thanks.
        2) Added.
        3) The symbol looks very cool.

        Comment by ideawerkz — April 19, 2004 @ 4:18 AM

      • Re: Grounds up …
        Ah, found it … here
        Its mostly Linux Assembly but I have used it as a starting point for
        a programming course in C too.
        The book is now available in print too, it seems .. check out the details here
        Hope you’ll like it.

        Comment by jnagal — April 19, 2004 @ 4:29 AM

      • Re: Grounds up …
        Ah, very interesting. Yes, I like it. Been wanting to relearn asm. Thanks.

        Comment by ideawerkz — April 19, 2004 @ 4:35 AM

    • Re: Grounds up …
      interesting idea, but I don’t think it’s feasible in this case. But teaching C as portable assembly is definitely a good idea. (just like teaching C++ as “these are the problems in C we tried to solve” is a good idea).

      Comment by mulix — April 19, 2004 @ 7:34 AM | Reply

  3. make
    I would probably jam in something about builds, libraries, dependencies and makefiles.
    This is not strictly C, but it is very tightly connected and usefull in many contexts (my knowledge of make helpped me learn to work better with VC++)

    Comment by shapirac — April 19, 2004 @ 4:50 AM | Reply

    • Re: make
      builds and Makefiles – just the bare necessities
      libraries – don’t think I’ll have time…
      dependencies – hmpf… don’t think I have time either (although I agree about the importance of all of the above).

      Comment by mulix — April 19, 2004 @ 7:35 AM | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: