文件名称:Effective_CPP
-
所属分类:
- 标签属性:
- 上传时间:2016-01-18
-
文件大小:22.71kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
虽然多年前在本科课程中学过C++,但之后的几年里,C++主要被我用来进行简单的算法实现或者简单的学术仿真程序的编写,一直没有深入实践过“面向对象的C++”、“泛型的C++”。因此,自己还是一个彻头彻尾的C++初学者。这里从初学者的角度谈谈读了这本书以后对C++的几点新理解新体会。
1,C++追求程序执行的效率,因而牺牲了一些编程开发的便利性。
书中好几个例子提到了这一点。比如,C++类中的方法都是默认non-virtual的。virtual函数会造成额外的开销,空间上要增加Virtual Table和指针,时间上需要通过函数指针查询正确的函数,增加了函数调用时间(条款7)。而Java中,则默认所有函数都是virtual的。又比如,函数的缺省参数值采用了静态绑定的方法,无需运行时动态决定,这就导致了如果在derived class覆盖了base class的缺省参数值,实际上是无法通过base class的指针使用覆盖后的缺省参数值的(条款37)。另外还有垃圾回收机制,很多现代的编程语言都支持,但是C++里却没有强制编译器实现垃圾回收功能。-Although many years ago in the undergraduate curriculum in middle school over C++, but after a few years, C++ is mainly I used simple algorithm realization or simple academic simulation program is written, there has been no in-depth practice object oriented C++ , a generic C++ . Therefore, he was an out and out C++ beginner. Here a beginner s point of view to read the book after the C++ of several new understanding of the new experience.
1, C++ pursues the efficiency of program execution, and thus sacrifices some of the convenience of programming development.
Several examples of this are mentioned in the book. For example, the method in the C++ class is the default non-virtual. Virtual function will cause extra overhead, space to increase the Table Virtual and pointer, the time needed to query the correct function through the function pointer, increasing the function call time (clause 7). And Java, the default all functions are virtual. As another example, the function of the defa
1,C++追求程序执行的效率,因而牺牲了一些编程开发的便利性。
书中好几个例子提到了这一点。比如,C++类中的方法都是默认non-virtual的。virtual函数会造成额外的开销,空间上要增加Virtual Table和指针,时间上需要通过函数指针查询正确的函数,增加了函数调用时间(条款7)。而Java中,则默认所有函数都是virtual的。又比如,函数的缺省参数值采用了静态绑定的方法,无需运行时动态决定,这就导致了如果在derived class覆盖了base class的缺省参数值,实际上是无法通过base class的指针使用覆盖后的缺省参数值的(条款37)。另外还有垃圾回收机制,很多现代的编程语言都支持,但是C++里却没有强制编译器实现垃圾回收功能。-Although many years ago in the undergraduate curriculum in middle school over C++, but after a few years, C++ is mainly I used simple algorithm realization or simple academic simulation program is written, there has been no in-depth practice object oriented C++ , a generic C++ . Therefore, he was an out and out C++ beginner. Here a beginner s point of view to read the book after the C++ of several new understanding of the new experience.
1, C++ pursues the efficiency of program execution, and thus sacrifices some of the convenience of programming development.
Several examples of this are mentioned in the book. For example, the method in the C++ class is the default non-virtual. Virtual function will cause extra overhead, space to increase the Table Virtual and pointer, the time needed to query the correct function through the function pointer, increasing the function call time (clause 7). And Java, the default all functions are virtual. As another example, the function of the defa
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Effective_C++.docx
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.