注册 | 登录读书好,好读书,读好书!
读书网-DuShu.com
当前位置: 首页出版图书科学技术计算机/网络软件与程序设计程序设计综合Code Reading:The Open Source Perspective

Code Reading:The Open Source Perspective

Code Reading:The Open Source Perspective

定 价:¥49.80

作 者: (美)Diomidis Spinellis著
出版社: 中国电力出版社
丛编项: 原版风暴系列
标 签: 高级程序语言设计

ISBN: 9787508321820 出版时间: 2004-04-01 包装: 胶版纸
开本: 24cm+光盘1片 页数: 460 字数:  

内容简介

  如果你是个程序员的话,那么你就需要本书,本书帮助你:当需要向一个超过3万行代码的程序中添加新功能时,该从哪里开始呢?该如何去理解一段用来同进解决多件事情的代码呢?当需要解决一个复杂的编边过程时,该从哪里开始呢?可能导致我们阅读代码的原因陋就简:我们不得不去修复它其中所包含的错误,或者是对它进行遍查(inspect)或者是改善它,我们阅读代码的方式可能和工程师检查机械的方式一样:找出它的工作原理,或者我们阅读代码的目的是对代码进行清理:找出其中可以被重用的部分阅读代码有它自身的技巧,并需要我们能够在重要场合对采用何种技术有判断能力,在这本不可或缺的书中,Diomidisspinellis使用了超过6个来自现实世界中的例子来向我们展示如何鉴别好的或坏的代码,如何去阅读它,从中去找寻什么,以及如何利用这种技巧来提升我们自身编写的代码的品质,请记住这个事实,如果我们养成了阅读好代码的习惯,我们就能写出品质更高的代码。

作者简介

  DiomidisSpinellis从1985年起,就为许多具有创造性的并获得广泛赞誉的商业及开源项目编写和维护超过了250000行代码,与此同时他与逐步完善了本书中所介绍的技术。他从伦敦大学帝国学院获得了软件工程学科的工程学硕士学位和计算机科学学科的博士学位。现在他是雅典经贸大学管理科学及技术系的助理教授。

图书目录

 Figures xiii
 Tables xix
 Foreword xxi
 Preface xxv
 1 Introduction 1
 1.1 Why and How to Read Code 2
 1.1.1 Code as Literature 2
 1.1.2 Code as Exemplar 5
 1.1.3 Maintenance 6
 1.1.4 Evolution 7
 1.1.5 Reuse 9
 1.1.6 Inspections 9
 1.2 How to Read This Book 10
 1.2.1 Typographical Conventions 10
 1.2.2 Diagrams 12
 1.2.3 Exercises 13
 1.2.4 Supplementary Material 14
 1.2.5 Tools 14
 1.2.6 Outline 15
 1.2.7 The Great Language Debate 15
 Further Reading 17
 2 Basic Programming Elements 19
 2.1 A Complete Program 19
 2.2 Functions and Global Variables 25
 2.3 while Loops, Conditions, and Blocks 28
 2.4 switch Statements 32
 2.5 for Loops 34
 2.6 break and continue Statements 37
 2.7 Character and Boolean Expressions 39
 2.8 goto Statements 43
 2.9 Refactoring in the Small 45
 2.10 do Loops and Integer Expressions 51
 2.11 Control Structures Revisited 54
 Further Reading 60
 3 Advanced C Data Types 61
 3.1 Pointers 61
 3.1.1 Linked Data Structures 62
 3.1.2 Dynamic Allocation of Data Structures 62
 3.1.3 Call by Reference 63
 3.1.4 Data Element Access 65
 3.1.5 Arrays as Arguments and Results 65
 3.1.6 Function Pointers 67
 3.1.7 Pointers as Aliases 70
 3.1.8 Pointers and Strings 72
 3.1.9 Direct Memory Access 74
 3.2 Structures 75
 3.2.1 Grouping Together Data Elements 75
 3.2.2 Returning Multiple Data Elements from a Function 76
 3.2.3 Mapping the Organization of Data 76
 3.2.4 Programming in an Object-Oriented Fashion 78
 3.3 Unions 80
 3.3.1 Using Storage Efficiently 80
 3.3.2 Implementing Polymorphism 81
 3.3.3 Accessing Free Memory 82
 3.4 Dynamic Memory Allocation 84
 3.4.1 Managing Free Memory 87
 3.4.2 Structures with Dynamically Allocated Arrays 89
 3.5 typedef Declarations 91
 Further Reading 93
 4 C Data Structures 95
 4.1 Vectors 96
 4.2 Matrices and Tables 101
 4.3 Stacks 105
 4.4 Queues 107
 4.5 Maps 111
 4.5.1 Hash Tables 113
 4.6 Sets 116
 4.7 Linked Lists 117
 4.8 Trees 125
 4.9 Graphs 131
 4.9.1 Node Storage 131
 4.9.2 Edge Representation 134
 4.9.3 Edge Storage 137
 4.9.4 Graph Properties 139
 4.9.5 Hidden Structures 139
 4.9.6 Other Representations 140
 Further Reading 140
 5 Advanced Control Flow 143
 5.1 Recursion 143
 5.2 Exceptions 150
 5.3 Parallelism 154
 5.3.1 Hardware and Software Parallelism 154
 5.3.2 Control Models 156
 5.3.3 Thread Implementations 162
 5.4 Signals 165
 5.5 Nonlocal Jumps 169
 5.6 Macro Substitution 172
 Further Reading 177
 6 Tackling Large Projects 179
 6.1 Design and Implementation Techniques 179
 6.2 Project Organization 181
 6.3 The Build Process and Makefiles 189
 6.4 Configuration 197
 6.5 Revision Control 202
 6.6 Project-Specific Tools 210
 6.7 Testing 215
 Further Reading 224
 7 Coding Standards and Conventions 225
 7.1 File Names and Organization 225
 7.2 Indentation 228
 7.3 Formatting 230
 7.4 Naming Conventions 234
 7.5 Programming Practices 237
 7.6 Process Standards 239
 Further Reading 240
 8 Documentation 241
 8.1 Documentation Types 241
 8.2 Reading Documentation 243
 8.3 Documentation Problems 254
 8.4 Additional Documentation Sources 256
 8.5 Common Open-Source Documentation Formats 260
 Further Reading 266
 9 Architecture 267
 9.1 System Structures 268
 9.1.1 Centralized Repository and Distributed Approaches 268
 9.1.2 Data-Flow Architectures 273
 9.1.3 Object-Oriented Structures 275
 9.1.4 Layered Architectures 279
 9.1.5 Hierarchies 282
 9.1.6 Slicing 283
 9.2 Control Models 285
 9.2.1 Event-Driven Systems 285
 9.2.2 System Manager 289
 9.2.3 Sate Transition 291
 9.3 Element Packaging 292
 9.3.1 Modules 293
 9.3.2 Namespaces 296
 9.3.3 Objects 300
 9.3.4 Generic Implementations 313
 9.3.5 Abstract Data Types 318
 9.3.6 Libraries 319
 9.3.7 Processes and Filters 323
 9.3.8 Components 325
 9.3.9 Data Repositories 325
 9.4 Architecture Reuse 328
 9.4.1 Frameworks 329
 9.4.2 Code Wizards 330
 9.4.3 Design Patterns 331
 9.4.4 Domain-Specific Architectures 333
 Further Reading 337
 10 Code-Reading Tools 339
 10.1 Regular Expressions 340
 10.2 The Editor as a Code Browser 343
 10.3 Code Searching with grep 346
 10.4 Locating File Differences 355
 10.5 Roll Your Own Tool 357
 10.6 The Compiler as a Code-Reading Tool 360
 10.7 Code Browsers and Beautifiers 365
 10.8 Runtime Tools 370
 10.9 Nonsoftware Tools 375
 Tool Availability and Further Reading 376
 11 A Complete Example 379
 11.1 Overview 379
 11.2 Attack Plan 380
 11.3 Code Reuse 382
 11.4 Testing and Debugging 388
 11.5 Documentation 396
 11.6 Observations 397
 A Outline of the Code Provided 399
 B Source Code Credits 403
 C Referenced Source Files 405
 D Source Code Licenses 413
 D.1 ACE 413
 D.2 Apache 415
 D.3 ArgoUML 416
 D.4 DemoGL 416
 D.5 hsqldb 417
 D.6 NetBSD 418
 D.7 OpenCl 418
 D.8 Perl 419
 D.9 qtchat 422
 D.10 socked 422
 D.11 vcf 422
 D.12 X Window System 423
 E Maxims for Reading Code 425
 Bibliography 445
 Author Index 459

本目录推荐