資源描述:
《Effective C ;More Effective C 》由會員上傳分享,免費在線閱讀,更多相關(guān)內(nèi)容在學術(shù)論文-天天文庫。
1、EffectiveC++byScottMeyersBacktoDedicationContinuetoAcknowledgmentsPrefaceThisbookisadirectoutgrowthofmyexperiencesteachingC++toprofessionalprogrammers.I'vefoundthatmoststudents,afteraweekofintensiveinstruction,feelcomfortablewiththebasicconstructsofthelanguage,butthe
2、ytendtobelesssanguineabouttheirabilitytoputtheconstructstogetherinaneffectivemanner.Thusbeganmyattempttoformulateshort,specific,easy-to-rememberguidelinesforeffectivesoftwaredevelopmentinC++:asummaryofthethingsexperiencedC++programmersalmostalwaysdooralmostalwaysavoi
3、ddoing.Iwasoriginallyinterestedinrulesthatcouldbeenforcedbysomekindoflint-likeprogram.Tothatend,IledresearchintothedevelopmentoftoolstoexamineC++sourcecodeforviolationsofuser-specifiedconditions.1Unfortunately,theresearchendedbeforeacompleteprototypecouldbedeveloped.
4、Fortunately,severalcommercialC++-checkingproductsarenowavailable.(You'llfindanoverviewofsuchproductsinthearticleonstaticanalysistoolsbymeandMartinKlaus.)Thoughmyinitialinterestwasinprogrammingrulesthatcouldbeautomaticallyenforced,Isoonrealizedthelimitationsofthatappr
5、oach.ThemajorityofguidelinesusedbygoodC++programmersaretoodifficulttoformalizeorhavetoomanyimportantexceptionstobeblindlyenforcedbyaprogram.Iwasthusledtothenotionofsomethinglessprecisethanacomputerprogram,butstillmorefocusedandto-the-pointthanageneralC++textbook.Ther
6、esultyounowholdinyourhands:abookcontaining50specificsuggestionsonhowtoimproveyourC++programsanddesigns.Inthisbook,you'llfindadviceonwhatyoushoulddo,andwhy,andwhatyoushouldnotdo,andwhynot.Fundamentally,ofcourse,thewhysaremoreimportantthanthewhats,butit'salotmoreconven
7、ienttorefertoalistofguidelinesthantomemorizeatextbookortwo.UnlikemostbooksonC++,mypresentationhereisnotorganizedaroundparticularlanguagefeatures.Thatis,Idon'ttalkaboutconstructorsinoneplace,aboutvirtualfunctionsinanother,aboutinheritanceinathird,etc.Instead,eachdiscu
8、ssioninthebookistailoredtotheguidelineitaccompanies,andmycoverageofthevariousaspectsofaparticularlanguagefeaturemaybedispersedthrou