您的位置:首页 > 理论基础 > 计算机网络

TCPL_1 notes to reader(这个章节现在我没有能力看太懂,留作以后再写笔记)

2011-01-04 15:59 337 查看
1.2 learning c++

the most important thing to do when learning c++ is to focus on conepts and not get lost in language-technical details. The purpose of learning a programming language is to become a better programmer; that is to become more effective at designing and implementing new systems and at maintaining old ones. For this, an appreciation of programming and design techniques is far moe important than an understanding of details; that understanding comes with time and practice.

对于程序设计和设计技术的理解比细节更加重要。

c++ supports a variety of programming styles. All are based on strong static type checking, and most aim at achieving a high level of abstraction and a direct representation of the programmer's ideas.

c++支持多种不同的程序设计风格。所有这些的基础是强类型检查,大部分的目标是要获得一种高层次的抽象,以直接表达程序员的思想。

1.3 the design of c++

simplicity was an important design criterion.

简单是非常重要是设计标准。

c++ has no built-in high-level data types and no high-level primitive operations. For example, the c++ language does not provide a matrix type with an iversion operator or a string type with a concatenation operator. If a user wants such a type, it can be defined in the language itself. In fact, defining a new general-purpose or application-specific type is the most fundamental programming activity in c++. A well-designed user-defined type differs from a built-in type in the way it is defined, not in the way it is used. The c++ standard library described in part 3 provides many examples of such types and their uses. From a user's point of view, there is little difference between a built-in type and a type provided by the standard library.

c++没有内置高级数据类型也没有高级的基本操作,例如,c++没有提供带有求逆运算的矩阵类型,也没有带拼接字符串的字符串类型。(我熟悉的std::string,和MFC的CString这些都不是c++语言提供的)

Features that would incur run-time or memory overheads even when not used were avoided in the design of c++. If a user declares a structure consisting of two 16-bit quantities, that structure will fit into a 32-bit register.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐