This is the essay of Mehran Sahami, professor of Open Class: Programming Methodology at Stanford University, which is open to NetEase.
Currently only see the third class, "Karel and Java", my harvest has the following points:
1. Software engineering is different from normal writing code. Software should consider a lot of things, such as portability, easy to upgrade maintenance, and so on, not just write code to implement the function as simple.
2. The code is written to the machine, but more important is that people can understand it. (The amount of work or time spent in post-code maintenance and so on is 10 times times as much as writing code, so it's important to make the code more prescriptive and easier for people to read)
3. Define exactly the functions of a function, a class, a package. Good code, to high cohesion and low coupling.
4. Achieve the lowest level of functionality, through which you can achieve more functionality, solve the problem more universal, do not need to change the code frequently. (a bit of top-down meaning, start by considering all possible situations and be prepared)
5. In a class file, the main function is at the top, and the main function defines the approximate steps to implement the function. The specific implementation of each step is written in the following way. The code is written by us, so don't worry about undefined functions, we can write them out. (Learning should also be done in the same way as a question-and-answer.) All problems should be considered as problems, not the rationale.
Stanford University Open Class: Programming methodology