With the same insight and authority that made their book The Unix Programming Environment a classic, Brian Kernighan and Rob Pike have written The Practice of Programming to help make individual programmers more effective and productive. This book is full of practical advice and real-world examples in C, C++, Java, and a variety of special-purpose languages. Kernighan and Pike have distilled years of experience writing programs, teaching, and working with other programmers to create this book. Anyone who writes software will profit from its principles and guidance.
......(更多)
Brian W.Kernighan和Rob Pike在朗讯科技贝尔实验室的计算机科学研究中心工作。Brian Kernighan是Addison-Wesley的“专业计算丛书”顾问编辑,也是《C程序设计语言》的合著者之一(与Dennis M.Ritchie合作)。Rob Pike是Plan 9和Inferno操作系统的主要结构设计与实现者,他的主要研究兴趣是如何帮助人们更容易地开发软件。
......(更多)
......(更多)
对返回布尔类型值(或真/假)的函数命名时,应该清楚地反映其返回值情况。比如下面的命名就不是很好了: if (checkoctal(c)) ... 因为这里函数名字就没有指明什么时候返回真,什么时候返回假。而下面这种写法就挺好: if (isoctal(c)) ... 这样就把返回真假的情况指明了。
......(更多)