Code reading: the open source perspective
2008-08-19 21:31
603 查看
版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章原始出版、作者信息和本声明。否则将追究法律责任。http://blog.csdn.net/topmvp - topmvp
What do we ever get nowadays from reading to equal the excitement and the revelation in those first fourteen years? -- Graham Greene The reading of code is likely to be one the most common activities of a computing professional, yet it is seldom taught as a subject, or formally used as a method for learning how to design and program. One reason for this sad situation may have been the lack of high-quality code to read. Companies often protect source code as a trade secret and rarely allow others to read, comment, experiment, and learn from it. In the few cases where important proprietary code was allowed out of a company's closet, it has spurred enormous interest and creative advancements. As an example, a generation of programmers benefited from John Lions' Commentary on the UNIX Operating System that listed and annotated the complete source code of the sixth edition UNIX kernel. Although Lions' book was originally written under a grant from AT as the NetBSD code continuously evolves, presenting examples from a more recent version would mean risking that those realistic gems would have been corrected. I chose the rest of the systems I used in the book's examples for similar reasons: code quality, structure, design, utility, popularity, and a license that would not make my publisher nervous. I strived to balance the selection of languages, actively looking for suitable Java and C++ code. However, where similar concepts could be demonstrated using different languages I chose to use C as the least common denominator. I sometimes used real code examples to illustrate unsafe, non-portable, unreadable, or otherwise condemnable coding practices. I appreciate that I can be accused of disparaging code that was contributed by its authors in good faith to further the open-source movement and to be improved upon rather than be merely criticized. I sincerely apologize in advance if my comments cause any offence to a source code author. In defense I argue that in most cases the comments do not target the particular code excerpt, but rather use it to illustrate a practice that should be avoided. Often the code I am using as a counter example is a lame duck, as it was written at a time where technological and other restrictions justified the particular coding practice, or the particular practice is criticized out of the context. In any case, I hope that the comments will be received good-humouredly, and openly admit that my own code contains similar, and probably worse, misdeeds. http://rapidshare.com/files/51342531/0201799405.zip
What do we ever get nowadays from reading to equal the excitement and the revelation in those first fourteen years? -- Graham Greene The reading of code is likely to be one the most common activities of a computing professional, yet it is seldom taught as a subject, or formally used as a method for learning how to design and program. One reason for this sad situation may have been the lack of high-quality code to read. Companies often protect source code as a trade secret and rarely allow others to read, comment, experiment, and learn from it. In the few cases where important proprietary code was allowed out of a company's closet, it has spurred enormous interest and creative advancements. As an example, a generation of programmers benefited from John Lions' Commentary on the UNIX Operating System that listed and annotated the complete source code of the sixth edition UNIX kernel. Although Lions' book was originally written under a grant from AT as the NetBSD code continuously evolves, presenting examples from a more recent version would mean risking that those realistic gems would have been corrected. I chose the rest of the systems I used in the book's examples for similar reasons: code quality, structure, design, utility, popularity, and a license that would not make my publisher nervous. I strived to balance the selection of languages, actively looking for suitable Java and C++ code. However, where similar concepts could be demonstrated using different languages I chose to use C as the least common denominator. I sometimes used real code examples to illustrate unsafe, non-portable, unreadable, or otherwise condemnable coding practices. I appreciate that I can be accused of disparaging code that was contributed by its authors in good faith to further the open-source movement and to be improved upon rather than be merely criticized. I sincerely apologize in advance if my comments cause any offence to a source code author. In defense I argue that in most cases the comments do not target the particular code excerpt, but rather use it to illustrate a practice that should be avoided. Often the code I am using as a counter example is a lame duck, as it was written at a time where technological and other restrictions justified the particular coding practice, or the particular practice is criticized out of the context. In any case, I hope that the comments will be received good-humouredly, and openly admit that my own code contains similar, and probably worse, misdeeds. http://rapidshare.com/files/51342531/0201799405.zip
相关文章推荐
- 学习笔记之《Code Reading:The Open Source Perspective》Chapter two(part2)
- 学习笔记之《Code Reading:The Open Source Perspective》Chapter one
- Code Reading: The Open Source Perspective 各章精要2
- 学习笔记之《Code Reading:The Open Source Perspective》Chapter two(part1)
- 《Code Reading:The Open Source Perspective》Chapter two之Control Structures Revisited
- Code Reading: The Open Source Perspective 各章精要
- 作为程序员容易忽略的一些问题 读《Code Quality :The Open Source Perspective》有感
- Code Quality: The Open Source Perspective
- The Architecture of Open Source Applications - Berkeley DB
- The Architecture of Open Source Applications: Asterisk
- The Open Source Development Environment for .NET
- What does it mean to be an Open Source author? A story from the inside
- 推荐一本好书《The Architecture of Open Source Applications 》
- Some of the best Open Source Project's in VC++ & MFC
- Some of the best Open Source Project's in VC++ & MFC
- Open Source Software List: The Ultimate List
- The Architecture of Open Source Applications——阅读笔记part 1
- [转]Some of the Best Open Source Project's in VC++ & MFC
- Nagios - The Industry Standard In Open Source Monitorin
- The Architecture of Open Source Applications