代码大全(第二版)英文版
分類: 图书,计算机/网络,软件工程/开发项目管理,
作者: (美)迈克康奈尔著
出 版 社: 电子工业出版社
出版时间: 2006-12-1字数: 1000000版次: 1页数: 914印刷时间: 2006/12/01开本: 16开印次: 1纸张: 胶版纸I S B N : 9787121033629包装: 平装编辑推荐
“《代码大全》第1版在我看来堪称软件工程领域的经典之作一而第2版则更棒!”
——Ralph Johnson,伊利诺伊州立大学:《设计模式》(Design Patterns)作者之一
“无论您是新手还是经验丰富的开发人员,《代码大全》(第2版)都能教会您思考编程的最佳方法。”
——Jeffrey Richter(WWW.wintellect.com),《Microsoft NET框架程序设计》(AppfiedMicrosoft.NET Framework Programming)作者
“这本书是讲述软件构建的权威指南一准备孤身前往荒岛的程序员只要带上这本书就足够了。”
——Diomidis Spinellis,《代码阅读方法与实践》(Code Readin9:The Open Soume Perspective)作者
“Steve McConnell是一位既在一线实践,又能把其中奥妙讲个明白的少数人之一。”
——John Vlissides,IBM研究院; 《设计模式》(Design Patterns)作者之一
“Steve McConnell比任何人都懂得如何构建软件;我们十分庆幸他能把其所有的深邃见解和实践经验写成这样一本重要而新颖的图书。”
——“Visual Basic之父”Alan Cooper,《软件观念革命》(About Face 2.0)作者
Steve McConnell的原作《代码大全》(第1版)是公认的关于编程的最佳实践指南之一,在过去的十多年间,本书一直在帮助开发人员编写更好的软件。现在,作者将这本经典著作全新演绎,融入了最前沿的实践技术,加入了上百个崭新的代码示例,充分展示了软件构建的艺术性和科学性。McConnell汇集了来自研究机构、学术界以及业界日常实践的主要知识,把最高效的技术和最重要的原理交织融会为这本既清晰又实用的指南。无论您的经验水平如何,也不管您在怎样的开发环境中工作,也无论项目是大是小,本书都将激发您的思维一并帮助您构建高品质的代码。
从本书可以了解到如下这些经久不衰的技术与策略:
做出具有最小复杂度和最大创造性的设计
从协作式的开发中获益
应用防御式编程技术来减少并排查错误
发掘重构或改善代码的机会,并安全可靠地进行代码重构和改善
结合项目的规格合理选用恰当的构建技术
快速而有效地排除问题
尽早地正确解决关键构建问题
分别在项目的早期、中期以及后期加强代码的质量
内容简介
《代码大全(第2版)》是著名IT畅销书作者、IEEE Software杂志前主编、具有20年编程与项目管理经验的Steve McConnell十余年前的经典著作的全新演绎:第2版做了全面的更新,增加了很多与时俱进的内容,包括对新语言、新的开发过程与方法论的讨论,等等。这是一本百科全书式的软件构建手册,涵盖了软件构建活动的方方面面,尤其强调提高软件质量的种种实践方法。
作者特别注重源代码的可读性,详细讨论了类和函数命名、变量命名、数据类型和控制结构、代码布局等编程的最基本要素,也讨论了防御式编程、表驱动法、协同构建、开发者测试、性能优化等有效开发实践,这些都服务于软件的首要技术使命:管理复杂度。为了培养程序员编写高质量代码的习惯,书中展示了大量高质量代码示例(以及用作对比的低质量代码),提高软件质量是降低开发成本的重要途径。除此之外,本书归纳总结了来自专家的经验、业界研究以及学术成果,列举了大量软件开发领域的真实案例与统计数据,提高本书的说服力。
本书中所论述的技术不仅填补了初级与高级编程实践之间的空白,而且也为程序员们提供了一个有关软件开发技术的信息来源。本书对经验丰富的程序员、技术带头人、自学的程序员及没有太多编程经验的学生都是大有裨益的。可以说,只要您具有一定的编程基础,想成为一名优秀的程序员,阅读本书都不会让您失望。
作者简介
Steve McConnell 是Construx公司首席软件工程师。他是软件工程知识体系(SWEBOK)项目构建知识领域的先驱。Steve曾就职于微软、波音以及西雅图地区的一些公司,从事软件工程的研究。Steve McConnell是以下著作的作者:《快速开发Rapid Development》(1996)、《软件项目长存之道Software Project Survival Guide 》(1998)、和《专业软件开发Professional Software Development》(2004)的 作者。他的书作为杰出软件开发书籍,曾两次获得Software Development杂志的优震撼大奖。1998 年, Steve被Software Development杂志的读者评为软件业最具影响力的三大人物之一,与比尔.盖茨(Bill Gates)和李纳斯.托瓦兹(Linus Torvalds)齐名。而且,Steve还是SPC(Software Productivity Center,加拿大软件进程改进公司)的ESTIMATE Professional(的一款计划和估算工具)主要开发者, Software Development Productivity award(软件开发生产力大奖)的获得者。Steve从1984年就开始从事桌面软件产业,现在在快速开发方法论、工程估算、软件架构实施、性能调整、系统整合、和第三方合同管理方面已经具有专业的技术。
目录
Preface
Acknowledgments
ListofChecklists
ListofTables
ListofFigures
PartI LayingtheFoundation
1 WelcometoSoftwareConstruction
1.1 WhatIsSoftwareConstruction?
1.2 WhyIsSoftwareConstructionImportant?
1.3 HowtoReadThisBook
2 MetaphorsforaRicherUnderstandingofSoftwareDevelopment
2.1 TheImportanceofMetaphors
2.2 HowtoUseSoftwareMetaphors
2.3 CommonSoftwareMetaphors
3 MeasureTwice,CutOnce:UpstreamPrerequisites
3.1 ImportanceofPrerequisites
3.2 DeterminetheKindofSoftwareYou'reWorkingOn
3.3 Problem-DefinitionPrerequisite
3.4 RequirementsPrerequisite
3.5 ArchitecturePrerequisite
3.6 AmountofTimetoSpendonUpstreamPrerequisites
4 KeyConstructionDecisions
4.1 ChoiceofProgrammingLanguage
4.2 ProgrammingConventions
4.3 YourLocationontheTechnologyWave
4.4 SelectionofMajorConstructionPractices
PartII CreatingHigh-QualityCode
5 DesigninConstruction
5.1 DesignChallenges
5.2 KeyDesignConcepts
5.3 DesignBuildingBlocks:Heuristics
5.4 DesignPractices
5.5 CommentsonPopularMethodologies
6 WorkingClasses
6.1 ClassFoundations:AbstractDataTypes(ADTs)
6.2 GoodClassInterfaces
6.3 DesignandImplementationIssues
6.4 ReasonstoCreateaClass
6.5 Language-SpecificIssues
6.6 BeyondClasses:Packages
7 High-QualityRoutines
7.1 ValidReasonstoCreateaRoutine
7.2 DesignattheRoutineLevel
7.3 GoodRoutineNames
7.4 HowLongCanaRoutineBe?
7.5 HowtoUseRoutineParameters
7.6 SpecialConsiderationsintheUseofFunctions
7.7 MacroRoutinesandInlineRoutines
8 DefensiveProgramming
8.1 ProtectingYourProgramfromInvalidInputs
8.2 Assertions
8.3 Error-HandlingTechniques
8.4 Exceptions
8.5 BarricadeYourProgramtoContaintheDamageCausedbyErrors
8.6 DebuggingAids
8.7 DeterminingHowMuchDefensiveProgrammingtoLeaveinProductionCode
8.8 BeingDefensiveAboutDefensiveProgramming
9 ThePseudocodeProgrammingProcess
9.1 SummaryofStepsinBuildingClassesandRoutines
9.2 PseudocodeforPros
9.3 ConstructingRoutinesbyUsingthePPP
9.4 AlternativestothePPP
PartIII Variables
10 GeneralIssuesinUsingVariables
10.1 DataLiteracy
10.2 MakingVariableDeclarationsEasy
10.3 GuidelinesforInitializingVariables
10.4 Scope
10.5 Persistence
10.6 BindingTime
10.7 RelationshipBetweenDataTypesandControlStructures
10.8 UsingEachVariableforExactlyOnePurpose
11 ThePowerofVariableNames
11.1 ConsiderationsinChoosingGoodNames
11.2 NamingSpecificTypesofData
11.3 ThePowerofNamingConventions
11.4 informalNamingConventions
11.5 StandardizedPrefixes
11.6 CreatingShortNamesThatAreReadable
11.7 KindsofNamestoAvoid
12 FundamentalDataTypes
12.1 NumbersinGeneral
12.2 integers
12.3 Floating-PointNumbers
12.4 CharactersandStrings
12.5 BooleanVariables
12.6 EnumeratedTypes
12.7 NamedConstants
12.8 Arrays
12.9 CreatingYourOwnTypes(TypeAliasing)
13 UnusualDataTypes
13.1 Structures
13.2 Pointers
13.3 GlobalData
PartIV Statements
14 OrganizingStraight-LineCode
14.1 StatementsThatMustBeinaSpecificOrder
14.2 StatementsWhoseOrderDoesn'tMatter
15 UsingConditionals
15.1 ifStatements
15.2 caseStatements
16 ControllingLoops
16.1 SelectingtheKindofLoop
16.2 ControllingtheLoop
16.3 CreatingLoopsEasily--FromtheInsideOut
16.4 CorrespondenceBetweenLoopsandArrays
17 UnusualControlStructures
17.1 MultipleReturnsfromaRoutine
17.2 Recursion
17.3 goto
17.4 PerspectiveonUnusualControlStructures
18 Table-DrivenMethods
18.1 GeneralConsiderationsinUsingTable-DrivenMethods
18.2 DirectAccessTables
18.3 IndexedAccessTables
18.4 Stair-StepAccessTables
18.5 OtherExamplesofTableLookups
19 GeneralControlIssues
19.1 BooleanExpressions
19.2 CompoundStatements(Blocks)
19.3 NullStatements.
19.4 TamingDangerouslyDeepNesting
19.5 AProgrammingFoundation:StructuredProgramming
19.6 ControlStructuresandComplexity
PartV CodeImprovements
20 TheSoftware-QualityLandscape
20.1 CharacteristicsofSoftwareQuality
20.2 TechniquesforImprovingSoftwareQuality
20.3 RelativeEffectivenessofQualityTechniques
20.4 WhentoDoQualityAssurance
20.5 TheGeneralPrincipleofSoftwareQuality
21Co llaborativeConstruction
21.1 OverviewofCollaborativeDevelopmentPractices
21.2 PairProgramming
21.3 FormalInspections
21.4 OtherKindsofCollaborativeDevelopmentPractices
22 DeveloperTesting
22.1 RoleofDeveloperTestinginSoftwareQuality
22.2 RecommendedApproachtoDeveloperTesting
22.3 BagofTestingTricks
22.4 TypicalErrors
22.5 Test-SupportTools
22.6 ImprovingYourTesting
22.7 KeepingTestRecords
23 Debugging
23.1 OverviewofDebuggingIssues
23.2 FindingaDefect
23.3 FixingaDefect
23.4 PsychologicalConsiderationsinDebugging
23.5 DebuggingTools--ObviousandNot-So-Obvious
24 Refactoring
24.1 KindsofSoftwareEvolution
24.2 IntroductiontoRefactoring
24.3 SpecificRefactorings
24.4 RefactoringSafely
24.5 RefactoringStrategies
25 Code-TuningStrategies
25.1 PerformanceOverview
25.2 IntroductiontoCodeTuning
25.3 KindsofFatandMolasses
25.4 Measurement
25.5 Iteration
25.6 SummaryoftheApproachtoCodeTuning
26 Code-TuningTechniques
26.1 Logic
26.2 Loops
26.3 DataTransformations
26.4 Expressions
26.5 Routines
26.6 RecodinginaLow-LevelLanguage
26.7 TheMoreThingsChange,theMoreTheyStaytheSame
PartVI SystemConsiderations
27 HowProgramSizeAffectsConstruction
27.1 CommunicationandSize
27.2 RangeofProjectSizes
27.3 EffectofProjectSizeonErrors
27.4 EffectofProjectSizeonProductivity
27.5 EffectofProjectSizeonDevelopmentActivities
28 ManagingConstruction
28.1 EncouragingGoodCoding
28.2 ConfigurationManagement
28.3 EstimatingaConstructionSchedule
28.4 Measurement
28.5 TreatingProgrammersasPeople
28.6 ManagingYourManager
29 Integration
29.1 ImportanceoftheIntegrationApproach
29.2 IntegrationFrequency--PhasedorIncremental?
29.3 IncrementalIntegrationStrategies
29.4 DailyBuildandSmokeTest
30 ProgrammingTools
30.1 DesignTools
30.2 Source-CodeTools
30.3 Executable-CodeTools
30.4 Tool-OrientedEnvironments
30.5 BuildingYourOwnProgrammingTools
30.6 ToolFantasyland
Part VII SoftwareCraftsmanship
31 LayoutandStyle
31.1 LayoutFundamentals
31.2 LayoutTechniques
31.3 LayoutStyles
31.4 LayingOutControlStructures
31.5 LayingOutIndividualStatements
31.6 LayingOutComments
31.7 LayingOutRoutines
31.8 LayingOutClasses
32 Self-DocumentingCode
32.1 ExternalDocumentation
32.2 ProgrammingStyleasDocumentation
32.3 ToCommentorNottoComment
32.4 KeystoEffectiveComments
32.5 CommentingTechniques
32.6 IEEEStandards
33 PersonalCharacter
33.1 Isn'tPersonalCharacterOfftheTopic?
33.2 IntelligenceandHumility
33.3 Curiosity
33.4 IntellectualHonesty
33.5 CommunicationandCooperation
33.6 CreativityandDiscipline
33.7 Laziness
33.8 CharacteristicsThatDon'tMatterAsMuchAsYouMightThink
33.9 Habits
34 ThemesinSoftwareCraftsmanship
34.1 ConquerComplexity
34.2 PickYourProcess
34.3 WriteProgramsforPeopleFirst,ComputersSecond
34.4 ProgramintoYourLanguage,NotinIt
34.5 FocusYourAttentionwiththeHelpofConventions
34.6 PrograminTermsoftheProblemDomair
34.7 WatchforFallingRocks
34.8 Iterate,Repeatedly,AgainandAgain
34.9 ThouShaltRendSoftwareandReligionAsunder
35 WheretoFindMoreInformation
35.1 InformationAboutSoftwareConstruction
35.2 TopicsBeyondConstruction
35.3 Periodicals
35.4 ASoftwareDeveloper'sReadingPlan
35.5 JoiningaProfessionalOrganization
Bibliography
Index