2024年4月29日发(作者:)

《C++Beginner'sGuide》C++初学者指南中英双语对照译本1.1---C++简史(下)

C++IsBorn

C++的诞生

C++wasinventedbyBjarneStroustrupin1979,atBellLaboratoriesinMurrayHill,

initiallycalledthenewlanguage"CwithClasses".Howeverin1983thenamewanchangedtoC++.

C++是1979年比亚尼·斯特鲁普在新泽西州的莫里山的贝尔实验室发明的。最初他把这个新

的语言命名为“CwithClasses”。到了1983年被重新命名为C++。

StroustrupbuiltC++onthefoundationofC,includingallofC’sfeatures,attributes,andbenefits.

HealsoadheredtoC’sunderlyingphilosophythattheprogrammer,notthelanguage,isincharge.

Atthispoint,itiscriticaltounderstandthatStroustrupdidnotcreateanentirelynewprogramming

d,heenhancedanalreadyhighlysuccessfullanguage.

斯特鲁普在C语言的基础上创建了C++,包含全部C语言的特色、属性、和优点。并且他追

随着C语言的基础理念而不是追随C语言,这是很负责的。在这点上,很明确的事情是,斯

特鲁普没有创造出一个全新的编程语言,而是他增强了一个已经很成功了的编程语言。

MostofthefeaturesthatStroustrupaddedtoCweredesignedtosupportobject-oriented

nce,C++dinguponthefoundationof

C,dofhavingtolearnanentirelynew

language,aCprogrammerneededtolearnonlyafewnewfeaturesbeforereapingthebenefitsof

theobject-orientedmethodology.

斯特鲁普加入到C语言里去的新特性中大多数都是设计用来支持面向对象编程的。在本质上,

C++是C语言的面向对象版。由于是建立在C语言的基础之上,一位C语言程序员在享受面

向对象编程方法的好处之前只需要学习一些新的特性,而不是必须学习一门全新的计算机编

程语言。

WhencreatingC++,StroustrupknewthatitwasimportanttomaintaintheoriginalspiritofC,

includingitsefficiency,flexibility,andphilosophy,whileatthesametimeaddingsupportfor

y,hisgoalwasaccomplished.C++stillprovidesthe

programmerwiththefreedomandcontrolofC,coupledwiththepowerofobjects.

在创建C++的时候,斯特鲁普明白在增加面向对象编程支持的同时保持C语言的原本精神的

重要性,包括它的高效、弹性以及理念。非常幸运,他的目标实现了。C++给程序员提供了

自由的、可控的和有着强劲面向对象功能的C开发环境。

AlthoughC++wasinitiallydesignedtoaidinthemanagementofverylargeprograms,itisinno

,theobject-orientedattributesofC++canbeeffectivelyappliedto

tuncommontoseeC++usedforprojectssuchaseditors,

databases,personalfilesystems,networkingutilities,eC++

sharesC’sefficiency,muchhigh-performancesystemssoftwareisconstructedusingC++.Also,

C++isfrequentlythelanguageofchoiceforWindowsprogramming.

虽然C++是最初是为了帮助程序员管理非常大的编程项目而设计的,但不知限制在这方面。

事实上,C++的面向对象特性能有效的应用在任何程序设计上面。很经常的我们可以看到C++

被应用在编辑器、数据库、个人文档系统、网络工具、通讯方案等等项目上。这是因为C++

具有C语言的高效性,很多高性能的系统

软件都选用C++来编写。同样C++也被频繁应用于Windows编程。

TheEvolutionofC++

C++的演化

SinceC++wasfirstinvented,ithasundergonethreemajorrevisions,witheachrevisionaddingto

rdoccurred

duringtheC++lyearsago,workbeganonastandardforC++.

Towardthatend,ajointANSI(AmericanNationalStandardsInstitute)andISO(International

StandardsOrganization)stdraftoftheproposed

standardwascreatedonJanuary25,draft,theANSI/ISOC++committee(ofwhichI

wasamember),in

general,thisinitialdraftreflectedthestateofC++atthetime.

从C++发明以来,它经过了3次重大修改,增加和修改了语言的部分内容。第一次修改是1985

年,第二次是1990。第三次发生在C++的标准化过程中。一些年以前,C++标准化工作开始,

为了达成目标,一个联合ANSI(美国国家标准协会)和ISO(国际化标准组织)的标准化委

员会成立了。拟议的第一个标准草案创建于1994年1月25日。在那个草案中,ANSI/ISOC++

委员会(我是成员之一)忠实保持了当初斯特鲁普定下的特性还加入了其他人加入的特性,

不过,一般来说这个初稿反映了当时的C++状态。

SoonafterthecompletionofthefirstdraftoftheC++standard,aneventoccurredthatcausedthe

standardtobegreatlyexpanded:thecreationoftheStandardTemplateLibrary(STL)byAlexander

th

uenttothefirstdraft,thecommitteevotedto

includetheSTLinthespecificationforC++.TheadditionoftheSTLexpandedthescopeofC++

mportant,theinclusionoftheSTL,amongotherthings,

slowedthestandardizationofC++.

在完成C++标准初稿之后不久,发生了一件重要的事情使得C++标准产生非常大的扩展:那

就是亚历山大·斯捷潘诺夫创造的标准模板库(STL)。STL是一种通用的例程,你可以用它来

方便地操作数据,它既强大又简洁。不过它非常巨大,继第一稿以后,委员会一致决定将STL

加入到C++标准规范当中,STL的加入使得C++的标准大大扩展出了原有的范围。重要的是,

STL等其他东西的加入,减缓了C++标准化的过程。

ItisfairtosaythatthestandardizationofC++