Reading Assignment: All of Programming Chapter 1 Introduction
Source: All of Programming
The key aspect of programming is metacognition–think about how you think. According to Wikipedia, metacognition is “cognition about cognition”, “thinking about thinking”, “knowing about knowing”, becoming “aware of one’s awareness” and higher-order thinking skills.
The key skill of programming are universal–learning a new language is largely just a matter of learning its syntax.
Planing ahead is more important than dive into coding. Programming should be done in a manner that comes up with a complete plan(or algorithm) first and build(implement in code) second.
Given the problem of prime numbers, the author stressed the importance that programming is used to solving a class of problem.
Definition: An algorithm is a clear set of steps to solve any problem in a particular class.
Work at least one instance of the problem, involving drawing a diagram of the problem by hand.
- the problem is ill specified
- lack domain knowledge
Write down the steps to solve the particular instance, or write down a set of instructions.
An instruction with kind of complex is fine, as long as it has a clear meaning.
Difficulty: Thinking about the exact steps.
2 steps to generalize:
- taking particular values
- replacing the instance with the variables.
To ensure our steps right by testing with different values other than previous used ones. The only way to be completely sure that your algorithm is correct is to formally prove its correctness.
- cases that did not consider