Revised Feb 21, 2017
CS 106: Introduction to Computer Programming 2
General description
This course, together with its predecessor CS 105, offers a comprehensive introduction to practical computer programming to students who don't have previous programming experience. While the main theme of CS 105 is to develop basic skills in imperative programming (variable declarations, control flow, defining functions, basic object-oriented programming), in CS 106 we explore more general applications of programming in contexts of interest to visual artists and designers.
Logistics
Audience
- Required by students in the GBDA program and available to students from other programs
Normally available
- Winter
Related courses
- CS 105
For official details, see the UW calendar.
Software/hardware used
- Processing programming environment
Typical reference(s)
- Shiffman, Daniel, Learning Processing 2nd edition, Morgan Kaufmann
Required preparation
At the start of the course, students should be able to
- Declare variables in an imperative programming language and read and modify the values of those variables
- Write simple control flow structures, such as if statements, while loops, and for loops
- Write simple helper functions that capture repeated sub-computations
- Declare arrays and read and write elements in them
- Produce simple interactive sketches that draw shapes and respond to mouse and keyboard input
Learning objectives
At the end of the course, students should be able to
- Use strings and perform basic text processing operations
- Write programs that use basic user interface elements (buttons, sliders) and that support direct manipulation of simple shapes (circles, rectangles)
- Write a short recursive function
- Write programs that read data from external files and/or the internet and that store data in external files
- Use libraries to parse tabular data (CSV) and general tree-structured data (JSON)
Typical syllabus
Processing recap (3 hours)
- Review of programming concepts from CS 105, in terms of the basic structure of the Processing language: types, declarations, expressions, statements, and functions
Arrays (3 hours)
- High-level operations on arrays, including appending, concatenation, and removal
- Built-in array manipulation functions
Strings (3 hours)
- String class
- Working with characters and strings
- String comparisons
- Printing and displaying text
Input and output (3 hours)
- Loading files in various formats (text, images, illustrations) into Processing and writing files
Advanced shapes (3 hours)
- Drawing fancy shapes with beginShape() and endShape() using the PShape class
User interfaces (3 hours)
- Model-view-controller architecture
- Direct manipulation interfaces
- User interface toolkits
- ControlP5 library in Processing
Geometric context (3 hours)
- Use of translate(), rotate(), and scale() to modify a program’s coordinate system
- Building a hierarchy of transformations using pushMatrix() and popMatrix()
- Order of operations
Recursion and fractals (3 hours)
- Iterated function systems as a demonstration of recursion
Randomness and noise (3 hours)
- Random() function in detail
- Pseudorandomness
- Applications of randomness
- Introduction to noise()
Text processing (3 hours)
- Decomposing text into tokens
- Regular expressions
- Unicode
- Working with dates and times
Structured data processing (3 hours)
- Dealing with table-structured (CSV) and tree-structured (JSON) data
- Processing live data acquired from web APIs