Programming in the small
Program synthesis:
- Be able to solve small "pattern" problems (typically a function about a page long) and write a program that implements the solution. Examples are: traverse a list and find the sum, find the minimum; read input sequence and reject erroneous input; convert a letter grade to its numerical equivalent, find a substring of a certain type in the given input string.
- Be able to write programs about 250 lines long that solve small real problems. These programs contain several of the patterns, use functions to encapsulate ideas, may use existing or custom built tools, and are complete - in a sense that they include the input, output, and processing of exceptional cases.
- Examples are: read a text file and delete all appearances of duplicate words, read a file of course-credit hours-grade information and respond to simple queries (grade in a given course, GPA, number of credits, best grade).
- Be able to recognize common operations that occur within a given programming problem - and be able to name these operations.
- Examples are: data conversion, scaling, finding minimum or maximum, traversal, input filtering, output formatting.
Program analysis:
- Be able to use abstract data types without knowledge of their implementation, and be able to recognize violations of the abstraction boundary for an ADT.
- Be able to identify bugs in a small program and fix them (e.g. unused or uninitialized variables).
- Be able to identify the scope of an identifier.
- Be able to correlate assignments with potential uses of the value assigned, and to correlate uses of a variable with the set of assignments that potentially assigned the value of the variable at the point of use.
- Be able to write a conditional dispatch on the cases of an abstract data type, and to identify missing or default cases in a dispatch written by someone else.
- Be able to formulate the post-condition of a while loop given its loop invariant.
- Be able to identify the base and recursive cases of a simple recursion on values of a simple recursive data type such as a list or tree.
- Be able to hand simulate a small piece of code.