CS116 Lecture Notes - Exponential Growth
Document Summary
Don"t focus on the programming language; focus on the programming approach! Abstract list functions (where functions are parameters) Write purpose: write examples, write body of function. Use a suitable template (can save effort and mistakes: write tests. Make sure to test every part of the code, as well as every possible scenario (for cs 116, only need to test valid data) Revise your tests until every part of the code gives the expected answer. Design recipe is not a limit to creativity when designing programs, but rather a framework to keep programs neat and readable for everyone. Contracts and purpose can also reduce syntax errors. Good design and template choices can reduce logic errors and provide better solutions (basically, save you effort) Related data values in a single type. Selector functions (used to extract items within structure) Require at least 1 base case and at least one recursive case.