Program Design and Development · 程序的设计与开发
| English | 中文 | Pinyin · 拼音 |
|---|---|---|
| process/ˈprəʊses/ | 过程 | guò chéng |
| development process/dɪˈveləpmənt ˈprəʊses/ | 开发流程 | kāi fā liú chéng |
| iterative/ˈɪtərətɪv/ | 迭代的 | dié dài de |
| prototype/ˈprəʊtəʊtaɪp/ | 原型 | yuán xíng |
| test/test/ | 测试 | cè shì |
| incremental/ˌɪŋkrɪˈmentl/ | 增量的 | zēng liàng de |
| program requirement/ˈprəʊɡræm rɪˈkwaɪəmənt/ | 需求 | xū qiú |
| Pseudocode/ˈsuːdəʊkəʊd/ | 伪代码 | wěi dài mǎ |
| comment/ˈkɒment/ | 注释 | zhù shì |
| Refining/rɪˈfaɪnɪŋ/ | 改进 | gǎi jìn |
Coding is a process, not one burst
- Writing a program is a process 过程, not a single burst of typing.
- Skipping design and coding right away usually wastes time.
- Experienced programmers follow a repeatable development process 开发流程.
- Best of all, the process loops — you improve a little each time around.
编码是一个过程,不是一次爆发
- 写一个程序是一个过程(process),不是一次性地敲完。
- 跳过设计、立刻编码通常浪费时间。
- 有经验的程序员遵循一个可重复的开发流程(development process)。
- 最妙的是,这个过程会循环——你每转一圈都改进一点。
Good practice is to start coding immediately, skipping design. · 好的做法是立刻开始编码,跳过设计。
Skipping design usually wastes time — plan first, then code. · 跳过设计通常浪费时间——先规划,再编码。
The iterative cycle
- A common cycle has four stages: investigate, design, prototype 原型, test 测试.
- Investigate: understand the problem and the users — what inputs and outputs matter?
- Design the structure, build a rough prototype, then test it with many inputs.
- The process is iterative 迭代的 and incremental 增量的: repeat, improving a little each pass.
迭代循环
- 一个常见的循环有四个阶段:调查、设计、原型(prototype)、测试(test)。
- 调查:理解问题和用户——哪些输入和输出重要?
- 设计结构,建一个粗糙的原型,然后用许多输入测试它。
- 这个过程是迭代的(iterative)和增量的(incremental):重复,每一遍改进一点。
The iterative development cycle · 迭代开发循环
Development loops through investigate, design, prototype, and test — improving the program a little on each pass. · 开发循环经过调查、设计、原型和测试——每一遍改进程序一点。
Order one pass of the development cycle. · 把开发循环的一遍排序。
Investigate → design → prototype → test, then loop back. · 调查 → 设计 → 原型 → 测试,然后循环回去。
A process that repeats its stages, improving a little each time, is ______. · 一个重复其阶段、每次改进一点的过程是______的。
Iterative and incremental development loops to refine the program. · 迭代和增量的开发循环着改进程序。
Planning tools
- A program requirement 需求 is a specific thing the program must do — list them first to stay focused.
- Pseudocode 伪代码 is a plain-language sketch of the logic, written before real code.
- It reads like English but follows a program's step-by-step shape, so a team can agree on the plan.
Pseudocode for a guessing game: pick a secret number → ask the user for a guess → if it is too high or too low, say so and ask again → repeat until the guess is correct. No exact syntax, just the plan.
规划工具
- 一个需求(program requirement)是程序必须做的一件具体的事——先列出它们以保持专注。
- 伪代码(pseudocode)是逻辑的白话草图,在真代码之前写。
- 它读起来像英语,但遵循程序的分步形状,所以团队能对计划达成一致。
一个猜数游戏的伪代码: 挑一个秘密数字 → 要用户给一个猜测 → 如果太高或太低,就说出来并再要一次 → 重复直到猜对。没有确切语法,只有计划。
Pseudocode is: · 伪代码是:
It reads like English but follows a program's step-by-step shape. · 它读起来像英语,但遵循程序的分步形状。
A comment in source code is: · 源代码中的注释是:
Comments explain tricky code to human readers. · 注释向人类读者解释棘手的代码。
Refining a program after testing is a normal, expected part of development. · 测试后改进程序是开发中正常、预期的一部分。
A first version is rarely the final one. · 第一个版本很少是最终版本。
Keeping it understandable
- A comment 注释 is a note in the source that the computer ignores but humans read.
- Teams also keep a development log recording their thinking.
- Key mindset: a first version is rarely the final one.
- Refining 改进 a program after testing is normal and expected, not a failure.
保持可理解
- 一个注释(comment)是源代码中的一条笔记,计算机忽略它但人读它。
- 团队还保留一份记录他们思路的开发日志。
- 关键心态:第一个版本很少是最终版本。
- 测试后改进(refining)程序是正常且预期的,不是失败。
Programming is an iterative development process: investigate → design → prototype → test, looping to improve a little each pass. Plan with clear requirements and pseudocode, keep the code readable with comments, and expect to keep refining — a first version is rarely the last.
编程是一个迭代的****开发流程:调查 → 设计 → 原型 → 测试,循环着每一遍改进一点。用清晰的需求和伪代码规划,用注释保持代码可读,并预期不断改进——第一个版本很少是最后一个。