The Summary of Chapter 1

To be an outstangding programmer

----Thesummary of Chapter 1

I havealready read the Chapter 1 of <<Data Structures and Program Design in C++>>,It mainly talks about Programming Principles,I think some sentencesfrom this chapter are very useful .

                                                                                                     1.1 Introduction

1.Programdesign and data-storage methods

“Thegreatest difficulties of writing large computer programs are not in decidingwhat the goals of the program should be,nor even in finding methods that can beused to reach these goals.”I think Programming should be an efficient work,wemust find the best way to solve the problem!

2.Programcorrectness

Reducethe number of errors,making it easier to spot those that remain.

Enable usto verify in advance that our algorithms are correct.

Provideus with ways to test our programs so that we can be reasonably confident thatthey will not misbehave(没规矩).

3.C++

C++allows data abstraction, it also supports object-oriented design,improves onseveral of the inconvenient and dangerous aspects of C.

It’s thecombination of flexibility,generality and efficiency that has made C++ one ofthe most popular choices for programmers at the present time.

                                                                                                  1.2The Game of Life

Afterreading this part,I have a new comprehension of the concept of shape.在学习离散数学的时候,总觉得图是很抽象的东西,后来我慢慢地体会到了其中的奥妙,图能够在计算机中存在,首先要捕捉他有哪些具体化、数字化的信息,比如说权值、顶点个数等,这也就说明了想要把生活中的信息转化到计算机中必须用数字来完整的构成一个信息库,而图的存在,又涉及到了顶点之间的联系,这就是一件很巧妙的事情。

Thesolution:Classes,Objects,and Methods.

Just aswe divided the Life class implenmentation between two files,we should dividethe utility package between the files utility.h and utility.c to allow for itsuse in the various translation units of a large program.In particular,we shouldplace function and variable definitions into the file utility.c,and we placeother sorts of utility instructions,such as the inclusion of standard C++library files,into utility.h.As we develop programs in future chapters,we shalladd to the utility package.

                                                                                                1.3Programming Style

ProgrammingPrecept:

1.     Alwaysname your classes,variables and functions with the greatest care,and explainthem thoroughly.

2.     Keepyour documentation concise but descriptive.

3.     Thereading time for programs is much more than the writing time.Make reading easyto do.

4.     Don’tlose sight of the forest for its trees.

5.     Useclasses to model the fundamental concepts of the program.

6.     Eachfunction should do only one task,but do it well.

7.     Eachclass or function should hide something.

8.     Keepyour connections simple.Avoid global variables whenever possible.

9.     Nevercause side effects if you can avoid it.If you must use global variables asinput,document them thoroughly.

1.4 Coding,Testing,and further Refinement

In thispart,It talks about stubs,definition of the Class life,CoutingNeighbors,Updating grid,Input and Output,Program Tracing,Principles of ProgramTesting.

1.5 Program Maintenance

1.Be sureyou understand your problem completely.If you must change its terms,exactlywhat you have done.

2.Designthe user interface with the greatest care possible.A program’s success dependsgreatly on its attractiveness and ease of use.

3.Do notoptimize your code unless it is necessary to do so.

4.Keepyour algorithms as simple as you can.When in doubt,choose the simple way.

5.Sometimespostponing problems simplifies their solution.

1.6 Conclusions and Preview

Thischapter has surveyed a great deal of ground,but just from a bird’s-eye view.SoI think best learn is from practice.

Nevercode until the specifications are precise and complete.

Startingafresh is often easier than patching an old program.

 

阅读之后,回想上一学期编程时候的场景,遇到errors的时候我就很烦,因为真是不知道错在哪里,但慢慢的我不断看到自己程序从不能运行到出现结果,因为有时候只要改动一个地方,就会少很多errors.编程只有自己经过Practice才来的彻底,来的深刻,程序practical很强,我还是动手少,思考少,在解决问题的过程中,充分体会到了数据结构,这门课程对于软件设计的重要性,也体会到了数据结构+算法=程序这句话的真正含义.

一个实际问题的解决第一步就是要依赖于良好的abstract思维,将实际问题转化为相应的

数据结构,只要这一步做好了,才能采取相应的算法和优化方法解决问题和解决好问题。

 

通过阅读第一章,我总结了在今后数据结构与算法课程学习中需要注意的以下几点:

1、巩固和加深对数据结构与算法的理解,提高综合运用本课程所学知识的能力。

2、培养选用参考书,查阅手册及文献资料的能力。培养独立思考,深入研究,分

析问题、解决问题的能力。

3、通过对编译系统的分析设计、编程调试,掌握应用软件的分析方法和工程设计方

法。

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值