ICS 45C Fall 2016
Schedule


In lieu of a course textbook, assigned readings are the Notes and Examples from lecture, which I'll try to keep posted ahead of where we are in lecture at any given time. It is a good idea to skim the assigned reading before the lecture for the main ideas, attend lecture, and then to go through the assigned reading again to fill in the details that you missed, both in your initial skim of the reading and in the lecture.

Date Lecture Topics Readings Project Work
Week 0
Th 9/22
  • Course introduction and goals
  • The challenge of learning a second programming language
  • The challenge of learning C++ as a second programming language
  • Historical perspective and philosophical backdrop
  • Why C++ is the way it is: design goals
  • Virtualization: Running more than one operating system simultaneously
  • Quick overview of the ICS 45C VM development environment
  • Compilation and linking of a C++ program
  • The main() function
  • Types and static type checking
  • Basic built-in data types
  • Console output using std::cout (briefly)
Week 1
Tu 9/27
  • Expressions and statements
  • The if statement
  • while and for loops
  • The distinction between lvalues and rvalues
  • Declaration vs. definition
  • Calling and declaring functions
  • Parameters and arguments
  • Begin working through Project #0
  • Aim to have the ICS 45C VM set up and ready to run today
Th 9/29
  • Behind the scenes of a C++ program
  • The Von Neumann architecture (briefly)
  • Registers, instruction pointers, stack pointers, and frame pointers
  • Calling conventions
Week 2
Tu 10/4
  • Separate compilation and linking
  • Source and header files
  • The #include directive
  • Guarding against multiple inclusion of the same header file
Th 10/6
  • A brief overview of standard input using std::cin
  • The std::string type
  • References
  • Pass-by-value vs. pass-by-reference parameters
  • Type conversions between basic built-in types
  • Function overloading
  • Default arguments
F 10/7 Project #0 due 11:59pm
Week 3
Tu 10/11
  • Behind the scenes of a C++ program (continued)
  • The heap (also known as the free store)
  • Heap-based memory allocation
  • The importance of cleaning up heap-allocated memory
  • Pointers
  • new and delete
  • The nullptr constant
Th 10/13
  • Single-dimension arrays
  • Statically- and dynamically-allocated arrays
  • How arrays and pointers are related
  • Passing arrays as parameters to functions
  • The delete[] operator
  • C-style strings (and why we mostly avoid them)
Week 4
M 10/17 Project #1 due 11:59pm
Tu 10/18
  • Constants and the const qualifier
  • How const affects references and pointers
  • On the need for creating new types
  • Structures
  • Members in a structure
  • Statically- and dynamically-allocated structures
  • The . and -> operators
  • Uniform initialization and structures
Th 10/20
  • The (lack of a) distinction between built-in types and user-defined types
  • What is object-oriented programming?
  • Classes
  • Declaring classes
  • Access control (public and private)
  • Constructors
  • Member variables and member functions in a class
  • Statically- and dynamically-allocated objects of a class
  • Separating interface from implementation
Week 5
Tu 10/25
  • Properly implementing constructors (e.g., using initializers)
  • The this pointer
  • Making a class const-aware
  • "Well-behaved" classes
  • Managing object lifetime
  • Managing other objects allocated by an object
  • Destructors
  • Building a "well-behaved" ArrayList class
Th 10/27
  • Building a "well-behaved" ArrayList class (continued)
  • Copy constructors
  • Overloading the assignment operator
  • Guarding against self-assignment
Week 6
M 10/31 Project #2 due 11:59pm
Tu 11/1
  • Function objects, std::function, and lambda expressions
  • Implementing linked data structures
  • Unit testing
  • Writing unit tests using Google Test
Th 11/3
  • MIDTERM: regular lecture time and location
Week 7
Tu 11/8
  • std: The C++ Standard Library
  • Standard collections: std::vector and std::list
  • Iterators
  • auto and type inference
  • Generic algorithms
Th 11/10
  • Inheritance
  • Constructors and derived classes
  • Order of construction and destruction of member variables
  • Layout of objects of derived classes
F 11/11
  • UNIVERSITY HOLIDAY: Veterans Day — NO DISCUSSIONS/LABS TODAY
Week 8
Tu 11/15
  • Virtual functions and polymorphism
  • Why destructors sometimes need to be virtual, but constructors don't
  • Pure virtual functions
  • Abstract base classes
  • Why a class with nothing but pure virtual functions is still useful
Th 11/17
  • Implicit type conversions
  • Explicit constructors
  • Static members of a class
F 11/18 Project #3 due 11:59pm
Week 9
Tu 11/22
  • Designing classes more carefully
  • Contracts
  • Preconditions and postconditions
  • Class invariants
  • Exceptions
  • Throwing and catching exceptions
  • Exception safety
Th 11/24
  • UNIVERSITY HOLIDAY: Thanksgiving — NO LECTURE TODAY
F 11/25
  • UNIVERSITY HOLIDAY: Thanksgiving — NO DISCUSSIONS/LABS TODAY
Week 10
Tu 11/29
  • Why exceptions have a profound impact on design in C++
  • The "resource acquisition is initialization" (RAII) technique
  • Depending on destructors to automate release of memory and other resources
  • The "Rule of Zero"
  • Implementing a simple smart pointer
Th 12/1
  • Function templates
  • Class templates
F 12/2 Project #4 due 11:59pm
Finals Week
Th 12/8
  • FINAL EXAM: 4:00pm-6:00pm, HSLH 100A