ICS 65 Fall 2012
Schedule


All assigned readings are from the Savitch text, 5th Edition. 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.

Some lectures have little or no reading corresponding to them. In some cases, this is because a block of reading corresponds to more than one lecture. In other cases, the material covered in that lecture is not discussed in the textbook.

Date Lecture Topics Readings Project Due
Week 0
Th 9/27
  • 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
  • The design goals of C++
Week 1
Tu 10/2
  • The main() function
  • Types and static type checking
  • Basic built-in data types
  • Expressions and statements
  • Control structures
  • The distinction between lvalues and rvalues
  • Declaration vs. definition
  • Calling and declaring functions
  • Parameters and arguments
  • Ch. 1
  • Ch. 2.1 - 2.3
  • Ch. 3
Th 10/4
  • Behind the scenes of a C++ program
  • The Von Neumann architecture (briefly)
  • Registers, instruction pointers, stack pointers, and frame pointers
  • Calling conventions
  • References
  • Pass-by-value vs. pass-by-reference
  • Ch. 4.1
Week 2
Tu 10/9
  • Function overloading (briefly)
  • Default arguments
  • Separate compilation and linking
  • The #include directive
  • Guarding against multiple inclusion
  • Ch. 4.2
  • Ch. 11.1
Th 10/11
  • The std::string type
  • 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
  • Strings as parameters
  • Pointers
  • new and delete
  • The nullptr constant
  • Ch. 9.1
  • Ch. 9.3
  • Ch. 10.1
Week 3
Tu 10/16
  • Single-dimension arrays
  • Statically-allocated arrays
  • Dynamically-allocated arrays
  • How arrays and pointers are related
  • Passing arrays as parameters to functions
  • Pointer arithmetic
  • The delete[] operator
  • C-style strings (and why we mostly avoid them)
  • Constants and the const qualifier
  • How const affects references and pointers
  • Ch. 5.1 - 5.3
  • Ch. 10.2
Th 10/18
  • On the need for creating new types
  • Structures
  • Member variables in a structure
  • Statically- and dynamically-allocated structures
  • The . and -> operators
  • Behind the scenes of a C++ program (continued)
  • How structures are laid out in memory
  • Why padding is sometimes added between member variables of a structure
  • The (lack of a) distinction between built-in types and user-defined types
  • Classes
  • Ch. 6
Week 4
Tu 10/23
  • Declaring classes
  • Access control (public and private)
  • Constructors
  • Member variables and member functions in a class
  • The this pointer
  • Separating interface from implementation
  • Making a class const-aware
  • Statically- and dynamically-allocated objects
  • Ch. 7.1 - 7.2
W 10/24 Project #1 due 11:59pm
Th 10/25
  • Managing object lifetime
  • Destructors
  • Copy constructors
  • Overloading the assignment operator
  • Guarding against self-assignment
  • Building a "well-behaved" Vector class
  • Ch. 10.3
Week 5
Tu 10/30
  • MIDTERM — regular lecture time and location
Th 11/1
  • std: The C++ standard library
  • Standard collections: vector and list
  • Iterators
  • Ch. 19
Week 6
Tu 11/6
  • Iterators (continued)
  • auto and type inference (briefly)
  • Generic algorithms
  • std::function and lambda expressions
W 11/7 Project #2 due 11:59pm
Th 11/8
  • Inheritance
  • Constructors and derived classes
  • Order of construction and destruction of class members
  • Virtual functions and polymorphism
  • Ch. 14
  • Ch. 15
Week 7
M 11/12 University Holiday — Veterans' Day
Tu 11/13
  • Why destructors sometimes need to be virtual, but constructors don't (and can't!)
  • "Pure" virtual functions and abstract base classes
  • Behind the scenes of a C++ program (continued)
  • How inheritance and polymorphism are implemented
  • Why virtual functions have an added cost
Th 11/15
  • Implicit type conversions
  • Explicit constructors
  • Operator overloading
  • Ch. 8
Week 8
M 11/19 Project #3 due 11:59pm
Tu 11/20
  • Operator overloading (continued)
  • Friend functions and friend classes
  • Template functions
  • Why C++ provides lousy error messages when you misuse a template
  • Ch. 16.1
Th 11/22 University Holiday — Thanksgiving (NO LECTURE TODAY)
F 11/23 University Holiday — Thanksgiving
Week 9
Tu 11/27
  • Designing classes more carefully
  • Contracts
  • Preconditions and postconditions
  • Class invariants
  • Documenting contracts
  • Exceptions in C++
  • Throwing and catching exceptions
  • Exception safety: making sure that contracts hold true even when exceptions are thrown
  • Ch. 18
Th 11/29
  • Exception safety and guarantees
  • The basic guarantee, the strong guarantee, and no throw guarantee
  • Implementing an exception-safe version of our Vector class template
Week 10
M 12/3 Project #4 due 11:59pm
Tu 12/4
  • Implementing a standard-library-compliant container
  • What needs to be implemented in order to be standard-library-compliant
  • How to implement iterators, begin(), end(), rbegin(), and rend()
Th 12/6
  • Inheriting implementations with interfaces
  • Private and protected inheritance
Su 12/9 Project #5 due 11:59pm
Finals Week
Tu 12/11
  • FINAL EXAM: 4:00pm-6:00pm, ICS 174