书摘《How to design programs》(加上了翻译)

  • With "good programming", we mean an approach to the creation of software that relies on systematic thought, planning and understanding from the very beginning, at every stage and for every step.

翻译:什么是好的编程?好的编程是指靠系统地思考如何创建程序的方法——理解并策划,从最初到之后的每一个阶段和每一个步骤。

  • The key is to discover which functions are needed, how to connect them, and how to build them from basic ingredients.

翻译:关键点是什么?是去发现需要哪些功能,怎么联结这些功能,怎么用最基础的元素去构建这些功能。

  • In this context, "systematic program design" refers to a mix of two concepts: design recipes and iterative refinement.

翻译:因此“系统的程序构建”指的是两个概念的融合:设计流程迭代优化


设计流程的步骤:


1. From Problem Analysis to Data Definitions

Identify the information that must be represented and how it is represented in the chosen programming language. Formulate data definitions and illustrate them with examples.

翻译:

1. 分析问题,然后定义数据

确认好以后要用的信息,弄清楚这些信息是怎么被你使用的那门语言所表达的。
数据定义要严谨,为了更好的说明,最好再加上用例。


2. Signature, Purpose Statement, Header

State which data the desired function consumes and produces.
Articulate what the function computes as a concise one-line statement.
Define a stub that lives up to the signature.

翻译:

2.

弄明白想要实现的那些功能需要消耗和产生什么样的数据。把这些功能


你可能感兴趣的:(书摘《How to design programs》(加上了翻译))