Introduction
Lecture Notes for CS 190
Spring 2016
John Ousterhout
Course Motivation
- The most important overall idea in CS: problem decomposition.
- How to take a large, complex system and decompose it into
relatively independent pieces
- Not really taught in any classes
- Huge difference in productivity between average programmers and
the best programmers
- 10-100x
- What are the skills that distinguish elite programmers?
Complexity
- Biggest limitation in building large software systems is complexity
- Dependencies:
- Behavior in one part of system affects behavior elsewhere
- To understand how one piece of code works, must understand
many other pieces
- Obscurity: not obvious how/why the code works
- Complexity increases as system ages
- Complexity makes it hard to add features, fix bugs:
- Can't understand current behavior
- Can't predict the implications of a change
- Eventually, can't fix one bug without introducing another;
expensive to make new features work
- This class is about how to design software in order to minimize complexity
- Most important idea: decompose large system into pieces that
are mostly independent.
- Ideally:
- Each piece is relatively small
- Any improvement or bug fix involves only one piece:
- All code changes are in that piece
- Only that piece needs to be understood
- Makes improvements cheaper, faster
- Allows more functionality before system becomes unmaintainable
Course Structure
- Iteration
- Create a nontrivial application from scratch
- Give and receive criticism
- Rewrite to fix the problems
- Criticism:
- I will read all projects
- You will read each other's projects
- In-class code reviews
- Goal for course: beautiful code
- Clean, simple, obvious
- Correctness less important (within reason)
- The project: GUI text editor
- Work in teams of 2
- Code in Java
- Phase 1: build first version of application
- Phase 2: revise based on code reviews
- Phase 3: take someone else's project, add new functionality,
refactor existing structure
- Class format:
- Lectures (50 minutes)
- Code reviews, other in-class activities (75 minutes)
- Some classes cancelled to make time for programming
- Class attendance is mandatory
- Grading policy:
- No exams
- Grades based on project work and class participation
- Late days
- Office hours
- Piazza for communication
- Workload is front-end loaded
- Class participation is important
- Giving and receiving criticism is very important
- Expect to receive lots of feedback, may be intense:
- Unlikely that any of you is already a good programmer
- Small details matter
- Keep criticism constructive:
- It's about the code, not the person
- Remember that everyone is learning
- Need your feedback to improve the class (I'm learning also)
- Realistic expectations
- Can't become an elite programmer in 10 weeks
- Goal: teach you concepts that you can apply and refine over
5-10 years to become an elite programmer
- Red flags: things that tell you you are doing something wrong
- This class won't cover everything you need to know
- Key skill to develop in this class: deciding what is important
- Get started right away!