Schedule (Tentative!)
Week 1: Introduction and Overview (September 2 – September 6)
Lecture:
- Wednesday: Welcome to Intermediate Programming; Hacking "Hello World!" in C; Some troubling observations about the C compiler; A brief rundown of compiler options
-
Friday:
Handling arguments to C programs;
Using
manto learn stuff; A brief introduction tomakeand Makefiles; Data in C: Values, Types, Variables, Expressions
Section:
- Thursday: A Crash Course in Unix
Reading:
- Required: K&R 1: A Tutorial Introduction
- Recommended: Dennis M. Ritchie: The Development of the C Language
Week 2: Foundations of Programming in C (September 7 – September 13)
Lecture:
- Monday: Labor Day! No lecture!
- Wednesday: A warning about uninitialized variables; Finishing Data in C; Control in C: Conditionals
-
Friday:
Control in C: Repetitions;
Using
ctagsinvi; Usingcscope; Hacking simplecatandwcclones usinggetchar()andputchar()
Section:
- Tuesday: A Crash Course in Unix
-
Thursday:
Hacking a simple
grepclone
Reading:
- Required: K&R 2: Types, Operators, and Expressions; 3: Control Flow
Week 3: Functions, Independent Compilation, Arrays (September 14 – September 20)
Lecture:
-
Monday:
Using
indentto clean up code; Abstraction in C: Functions, Parameters, Results, Prototypes -
Wednesday:
What the compiler really does;
Independent compilation, object files, linking;
Include/Header files;
More on
makeand Makefiles -
Friday:
More on
makeand Makefiles; Usingstaticto hide parts of modules; Arrays, including passing them to functions; Usingstaticto make local variables live longer
Section:
-
Tuesday:
Hacking a simple
grepclone - Thursday: Hacking a simple Caesar Cipher
Reading:
- Required: K&R 4: Functions and Program Structure; 5: Pointers and Arrays
- Recommended: Rob Pike: Notes on Programming in C
Week 4: Independent Compilation, Files, Pointers (September 21 – September 27)
Lecture:
-
Monday:
Defensive programming using
assert; Hacking a stack module and an RPN calculator -
Wednesday:
Finishing the RPN calculator;
Introduction to Files,
examples of
fopen(),fclose(),fgetc(),fputc(),ftell(),fseek(),fread(),fwrite(), and so on; thestdin,stdout, andstderrfiles -
Friday:
Warnings about Assignment 4;
Introduction to pointers,
example
swapfunction; Pointers and arrays, address arithmetic, the truth about array indexing
Section:
- Tuesday: Hacking a simple Caesar Cipher
-
Thursday:
Using
gdb, the GNU debugger
Reading:
- Required: K&R 4: Functions and Program Structure; 5: Pointers and Arrays; 7: Input and Output
- Recommended: Peter Hosey: Everything you need to know about pointers in C (apparently JHU blocks this site, so here's a local copy)
Week 5: Assignment 4, Pointers, Dynamic Memory Allocation (September 28 – October 4)
Lecture:
-
Monday:
Discussion of Assignment 4;
Example
strcpyfunction (lots of versions); Thesizeofoperator -
Wednesday:
Some strange things about
sizeofin C; Basics of dynamic memory allocation, examples ofmalloc(),calloc(),realloc(), andfree(); Memory leaks and dangling pointers -
Friday:
Assignment 4 redux;
Working in pairs for Assignment 5;
How to do code reviews;
Using
splintfor static checking; RPN calculator revisited: stacks that grow by doubling the array when full
Section:
-
Tuesday:
Using
gdb, the GNU debugger -
Thursday:
Using
valgrind
Reading:
- Required: K&R 5: Pointers and Arrays; 7: Input and Output
- Recommended: Peter Hosey: Everything you need to know about pointers in C (apparently JHU blocks this site, so here's a local copy)
Week 6: Structs, Midterm, Structs (October 5 – October 11)
Lecture:
-
Monday:
Introduction to
structs; nestedstructs for hierarchical abstraction; usingtypedefto introduce simpler type names; pointers tostructs and the->operator; recursivestructs; assignments between arrays versus assignments betweenstructs, consequences for parameter passing - Wednesday: Midterm 1
- Friday: RPN calculator revisited: stacks implemented with linked lists
Section:
-
Tuesday:
Using
valgrind -
Thursday:
Using
mudflapandlibSegFault
Reading:
- Required: K&R 6: Structures
- Recommended: Review everything we've done so far in preparation for Midterm 1!
Week 7: Finishing Structs, Performance Tuning, Unit Testing (October 12 – October 18)
Lecture:
- Monday: Supporting multiple stacks; Brief overview of function pointers
-
Wednesday:
Performance Analysis and Tuning;
Using
gprof -
Friday:
Unit and System Testing;
Using
gcov
Section:
-
Tuesday:
Using
mudflapandlibSegFault -
Thursday:
Using
subversion
Reading:
- Required: K&R 6: Structures
- Recommended: Read everything in K&R that wasn't assigned before, we are about to finish C and move on to bigger (but not necessarily better) things...
Week 8: Introduction to C++ (October 19 – October 25)
Lecture:
-
Monday:
Introduction to C++;
Basics of
namespaces; Input and output usingstd::cinandstd::cout; Basics of operator overloading -
Wednesday:
Introduction to
std::string; Introduction tostructs andclasses,publicandprivate; Usingnewanddeleteto allocate and free objects; Handling input stream conditions properly -
Friday:
Handling input stream conditions properly (continued);
Hacking a
Counterclass; Implicit conversions, making constructorsexplicit; TBD
Section:
-
Tuesday:
Using
subversion -
Thursday:
Hacking a
stackclass in C++
Reading:
- Required: K&M 0: Getting started, 1: Working with strings, 2: Looping and counting
- Recommended: C++ Language Tutorial
- Optional: Bjarne Stroustrup: A History of C++: 1979-1991, 1993.
- Optional: Bjarne Stroustrup: Evolving a language in and for the real world: C++ 1991-2006, 2007.
Week 9: More C++ (October 26 – November 1)
Peter is going to be at OOPSLA 2009 until Thursday. There will still be lectures though, stay tuned!
Lecture:
-
Monday:
Introduction to
std::vector; Overview of templates; Introduction to iterators (Raluca's Guest Lecture) - Wednesday: No lecture!
-
Friday:
Some more details about
newanddelete; References versus Pointers; Destructors; Copy Constructors; Assignment Operators
Section:
-
Tuesday:
Hacking a
stackclass in C++ -
Thursday:
Introduction to
std::deque; review of iterators
Reading:
- Required: K&M 3: Working with batches of data, 4: Organizing programs and data, 5: Using sequential containers
- Optional: Scott Myers: The little endl that couldn't, C++ Report, November 1995.
Week 10: Even More C++ (November 2 – November 8)
Lecture:
-
Monday:
Introduction to Inheritance in C++;
Animals, Dogs, and Terriers example;
virtualmember functions and destructors -
Wednesday:
Discussion of Assignment 8;
Introduction to
std::map; Introduction to type-casts in C++ -
Friday:
Note on
protected; More on type-casts in C++, includingdynamic_cast; Overloading the output operator;frienddeclarations
Section:
-
Tuesday:
Introduction to
std::deque; review of iterators - Thursday: Introduction to Exceptions
Reading:
- Required: K&M 6: Using library algorithms; 7: Using associative containers; 8: Writing generic functions
Week 11: Never Ending C++, Midterm (November 9 – November 15)
Lecture:
- Monday: Introduction to templates; TBD
- Wednesday: Midterm 2
- Friday: TBD
Section:
- Tuesday: Introduction to Exceptions
- Thursday: TBD
Reading:
- Required: K&M 9: Defining new types; 10: Managing memory and low-level data structures; 11: Defining abstract data types