书摘《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.

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


最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 红尘落下的尽头 残花飘零的烂漫 暗香消逝的远方 你悄无声的离去 江城三月 锦花漫溯江南 秋水的江波 送不到...
    我叫张胖子阅读 2,563评论 1 0
  • #添加network namespace ip netnas add #Example: ip netns add...
    ximitc阅读 5,004评论 0 1
  • (一) 少年小菡在深川市一个写字楼上班,日复一日地过者平凡的一天,直到他遇见了一个在隔壁写字楼的女生,晓伟...
    菡少阅读 1,826评论 0 0
  • 首长找李云龙谈话:给你一个团能不能带好,你自己当团长。李云龙答:必须的,请问是让我带哪个团啊?首长答:没有哪个团,...
    傲梅寒雪阅读 4,272评论 1 2