- Real computational tasks are complicated.
-
To accomplish them effectively you need to think before you code.
- Decompose a coding problem:
- Understand the problem.
- Identify inputs and outputs.
- Break the problem down into a few pieces.
- Build an outline on paper or as comments.
- Break those pieces into codeable chunks.
- Code one chunk at a time.
- Understand the problem.
- Decompose a code chunk:
- Think about it.
- Write it.
- Test it ( on it’s own ).
- Fix any problems.
Demo decomposition-example.R.
Assign remaining exercises.