Schedule (Tentative!)
- Stuff listed in bold indicates a due date of some sort, attached to a grade item that will influence your final grade. See Assessment for more details.
- Assignments are due on the day listed before lecture! Tasks that don't have a specific time attached are due before midnight that day!
Lecture 0: Introduction and Overview (May 28)
Lecture:
- Welcome to "Introduction to Programming (in Java)"
- The "Computer Science" Misnomer and Other Inconvenient Truths
- Theory: Languages, Programs, and Machines
- Java: A View from 9,144 Meters
- Practice: Compilers, Interpreters
- Theory: Instructions and Expressions
- Java: Cryptic Incantations and Printing Stuff
- Theory: Values, Types, Operations
- Java: Integers, Floats, Strings, Overloaded Names and Operators, Precedence, Associativity, Coercion, Casting
Reading:
- S&W: Sections 1.1: Your First Program, 1.2: Built-in Types of Data
- Edsger W. Dijkstra: On the Cruelty of Really Teaching Computing Science, EWD 1036, December 1988. See also this article on Wikipedia.
Tasks:
- Grab Assignment 0 and get started!
- Introduce yourself on the course mailing list!
Lecture 1: Imperative Programming (May 30)
Lecture:
- Questions on Assignment 0
- Questions on Sections 1.1 and 1.2
- Java: Booleans, Characters, more on Strings, command-line arguments
- Discussion of the Dijkstra paper
- Dijkstra's Pebble Game
- Theory: State and Variables
- Java: Variables and Assignments
- Theory: Conditionals and Repetitions
- Java: Comparisons,
ifinstruction,whileloop - Java: Implementing the Pebble Game
Reading:
- S&W: Sections 1.3: Conditionals and Loops
- Paul Graham: Good and Bad Procrastination, December 2005. See also this article on Wikipedia.
Tasks:
- Hand in Assignment 0 and relax!
- Grab Assignment 1 and get started!
Lecture 2: More Imperative Programming (June 2)
Lecture:
- Questions on Assignment 1
- Questions on Sections 1.1, 1.2, and 1.3
- Java:
doandforloops - Java:
finalvariables (aka "constants") - Discussion of the Graham paper
- Java: More Examples of Simple Programs
- Theory: Characterizing State, Preconditions, Postconditions
- Java:
assert
Reading:
- S&W: Section 1.3: Conditionals and Loops
- Jeannette M. Wing: Computational Thinking, Communications of the ACM, vol. 49, no. 3, March 2006, pp. 33-35.
- Optional: Jorma Sajaniemi: An Introduction to the Roles of Variables (especially the table toward the bottom!)
- Optional: Programming with Assertions (mentions some advanced stuff we have not covered yet!)
Tasks:
- Hand in Assignment 1 and relax!
- Grab Assignment 2 and get started!
Lecture 3: Arrays (June 4)
Lecture:
- Questions on Assignment 2
- Questions on Sections 1.1, 1.2, and 1.3
- Code Reviews for Assignment 1: Gravity Problem
- Discussion of the Wing paper
- Theory: Arrays or "Bunches of Variables"
- Java: Working with Arrays
- Theory: Value Semantics versus Reference Semantics
- Java: Arrays as References
Reading:
- S&W: Section 1.4: Arrays
Tasks:
- Hand in Assignment 2 and relax!
- Grab Assignment 3 and get started!
Lecture 4: Input and Output (June 6)
Lecture:
- Questions on Assignment 3
- Questions on Sections 1.1, 1.2, 1.3, and 1.4
- Basics of Input and Output
- API:
StdInandStdOut - Redirection and Piping in Unix
- Basics of Computer Graphics
- API:
StdDraw - Basics of Electronic Sound
- API:
StdAudio
Reading:
- S&W: Section 1.5: Input and Output
- Donald E. Knuth: Computer Programming as an Art, December 1974. See also this article on Wikipedia. Our friend Paul Graham has an online version of Knuth's talk.
Tasks:
- Hand in Assignment 3 and relax!
- Grab Assignment 4 and get started!
Lecture 5: Abstractions: Functions and Procedures (June 9)
Lecture:
- Questions on Assignment 4
- Questions on Chapter 1 (please read 1.6 on your own if you didn't)
- Code Review for Assignment 4: Tic Tac Toe Problem
- Discussion of the Knuth paper
- Theory: Functions and Procedures as Abstractions
- Java: Static Methods as Functions and Procedures
- Example: Refactoring the Audio Demo using Static Methods
Reading:
Tasks:
- Hand in Assignment 4 and relax!
- Grab Assignment 5 and get started!
Lecture 6: Abstractions: Modules and Libraries (June 11)
Lecture:
- Questions on Assignment 5
- Questions on Chapter 1 and Section 2.1
- Midterm Exam
- Java: Scope and Lifetime of Variables
- Java: Side Effects and Referential Transparency
- Theory: Modular Programming, Interface and Implementation
- Java: Classes as Modules,
publicandprivate, Overloading - Example: Hacking
StdArrayIO - Example: Iterated Function Systems
- Java: Documenting APIs with
javadoc
Reading:
- S&W: Section 2.2: Libraries and Clients
Tasks:
- Hand in Assignment 5 and relax!
- Grab Assignment 6 and get started!
Lecture 7: Recursion (June 13)
Lecture:
- Questions on Assignment 6
- Questions on Sections 2.1 and 2.2
- Theory: Unit Testing, Automated Testing
- Java: Using
assertinmain()for unit testing - Theory: Recursion
- Java: Factorial Example
- Java: Towers of Hanoi Example
- Java: Hilbert Curve Example
Reading:
- S&W: Section 2.3: Recursion
Tasks:
- Hand in Assignment 6 and relax!
- Grab Assignment 7 and get started!
Lecture 8: Hacking Hard (June 16)
Lecture:
- Questions on Assignment 7
- Questions on Chapter 2 (please read 2.4 on your own if you didn't)
- Code Review for Assignment 7
-
Practice: Hacking the
Tracker,FilterandCountclasses for Assignment 7
Reading:
- Nothing really, but starting S&W: Chapter 3 was a good idea anyway
Tasks:
- Hand in Assignment 7 and relax!
- Grab Assignment 8 and get started!
Lecture 9: Object-Oriented Programming (June 18)
Lecture:
- Questions on Assignment 8
- Demo: The three coolest Moonraker games (plus two honorable mentions for general weirdness :-)
- Theory: Types, Classes, Objects, Methods, Messages
- Java: Recap of Reference Types,
newoperator - Example: A
Counterclass - Java: Look! No
staticexcept formain()! - Example: A
Bufferclass based on growing arrays - Theory: Growing arrays by Amortized Doubling
- Example: A
Bufferclass based on linked lists
Reading:
- S&W: Section 3.1: Data Types, 3.2: Creating Data Types
Tasks:
- Hand in Assignment 8 and relax!
- Grab Assignment 9 and get started!
Lecture 10: More Object-Oriented Programming (June 20)
Lecture:
- Questions on Assignment 9
- Java: Creating a
Timerclass - Java: Creating a
Turtleclass -
Java: Exploring
java.lang.Object: thetoString()andequals()methods - Theory: The Basics of Subtype Polymorphism
- Java: Inheritance and the
extendsclause - Java:
protectedvisibility for subclasses - Java:
abstractmethods and classes - Example:
Numberand subclasses for polymorphic arithmetic
Reading:
- S&W: Section 3.2: Creating Data Types, 3.3: Designing Data Types
Tasks:
- Hand in Assignment 9 and relax!
- Grab Assignment 10 and get started!
Lecture 11: Generics, Interfaces, Performance (June 23)
Lecture:
- Java: Introduction to Generics (Chancellor Pascale)
- Questions on Assignment 10
- Questions on Chapter 3 (please read 3.4 on your own if you didn't)
- Java: Interfaces and what they are good for
- Java: Nested classes and how to hide
NodeinsideLinkedBuffer - Example: Hacking a generic
LinkedBuffer<T>step-by-step - Example: Hacking a generic
Dictionary<K,V>based on generic buffers - Theory: Performance in time, space, power
- Theory: Experimental versus Asymptotic Performance Analysis (and using simplified models for the latter)
- Example: Linear Search O(n) versus Binary Search O(log n)
- Example: Bubble Sort O(n*n)
Reading:
- S&W: Section 4.1: Performance, 4.2: Searching and Sorting
Tasks:
- Hand in Assignment 10 and relax!
- Grab Assignment 11 and get started!
Lecture 12: Algorithms and Data Structures (June 25)
Lecture:
- Questions on Assignment 11
- Questions on Chapter 4
- TBD
Reading:
- Prepare for the final exam: Review the whole S&W book, go over all our lecture notes, review all the homeworks, form study groups, do all the sample exams, ask questions on the mailing list, feel confident on Friday! :-)
- Bernard Chazelle: Could Your iPod Be Holding the Greatest Mystery in Modern Science?, April 2006. See also this article on Wikipedia.
Tasks:
- Hand in Assignment 11 and relax!
- Grab Assignment 12 and get started!
Lecture 13: Le Grande Finale (June 27)
Lecture:
- Discussion of the Chazelle paper
- Stump The Chump (Q&A session with candy)
- Final Exam
- What to do if you don't like Java (aka How to forget Java but keep Hacking Happily Ever After)
Reading:
- Whatever you think helps...
- A.K. Dewdney: The (New) Turing Omnibus, 1993. [Buy] A collection of 66 interesting excursions into (almost) all areas of computer science, check it out if you want to appreciate the variety of CS ideas a little more.
- Neal Stephenson: Cryptonomicon, 1999. [Buy] See also this article on Wikipedia. You don't have to read this for the course, I am just recommending something for the rest of your summer. Enjoy!
Tasks:
- Hand in Assignment 12 and relax!
- If you feel comfortable doing it, please send us some feedback about how you liked the course and what we need to change for the future. Comments about the book are also most welcome! If you want you can wait until after you got your final grade... :-)