A Philosophy of Software Design (2/e)

John Ousterhout

出版社

Yaknyam Press

出版时间

2021-07-26

ISBN

9781732102217

评分

★★★★★
书籍介绍
这本书最见功力的地方,不在它教了你多少设计原则,而在它逼你承认:写软件最大的瓶颈,是我们理解自己正在构建的那些系统的能力。作者把'控制复杂度'当成唯一真正的问题反复打磨——并提出了几个极具争议的判断:异常应当被'消亡'而非'处理',信息泄漏往往源于'时间顺序'而非'技术分层',把系统切得越碎反而越复杂。它不回避与《代码整洁之道》的分歧,也不回避敏捷开发容易滑向'战术编程'、让复杂度快速累积的风险。多位读者提到,这本书适合'几乎没写过大项目'的人,因为它讲得接地气、重在实际例子。它更像一篇值得反复回读的论文,而非一劳永逸的手册——真正适合那些愿意在代码审查中,学会识别'坏味道'的人。
作者简介
John K. Ousterhout is a professor of computer science at Stanford University and chairman of Electric Cloud, Inc. Ousterhout created Tcl and is well-known for his work in distributed operating systems, high-performance file systems, and user interfaces. A member of the National Academy of Engineering and recipient of the ACM Software System Award (for Tcl), he has served as professor of computer science at UC Berkeley, distinguished engineer at Sun Microsystems, and CEO of Scriptics, which he founded.
AI导读
核心看点
  • 核心观点是管理复杂度,通过分解问题实现模块独立。
  • 提出“深模块”概念,主张接口简单而内部功能强大。
  • 识别设计红旗,通过消除异常和减少依赖降低认知负荷。
读者共识
  • 观点务实接地气,比传统整洁代码更契合现代开发实践。
  • 篇幅短小精悍,核心精华在前半部分,后半部分稍显冗余。
  • 作者是大牛,书中关于复杂度的见解极具启发性,值得推荐。
精彩摘录
  • "A Philosophy of Software Design Preface - The most fundamental problem in computer science is problem decomposition: how to take a complex problem and divide it up into pieces that can be solved independently. 1 Introduction ### 1.1 How to use this book - The best way to use this book is in conjunct"
  • "The best way to eliminate exception handling complexity is to define your APIs so that there are no exceptions to handle: define errors out of existence. This may seem sacrilegious, but it is very effective in practice. Consider the Tcl unset command discussed above. Rather than throwing an error wh"
  • "The second technique for reducing the number of places where exceptions must be handled is 【exception masking】. With this approach, an exceptional condition is detected and handled at a low level in the system, so that higher levels of software need not be aware of the condition. Exception masking i"
  • "One common cause of information leakage is a design style I call temporal decomposition. In temporal decomposition, the structure of a system corresponds to the time order in which operations will occur. Consider an application that reads a file in a particular format, modifies the contents of the f"
  • "When deciding whether to combine or separate, the goal is to reduce the complexity of the system as a whole and improve its modularity. It might appear that the best way to achieve this goal is to divide the system into a large number of small components: the smaller the components, the simpler each"
  • "One of the risks of agile development is that it can lead to tactical programming. Agile development tends to focus developers on features, not abstractions, and it encourages developers to put off design decisions in order to produce working software as soon as possible. For example, some agile pra"
  • "One of the best ways to improve your design skills is to learn to recognize red flags: signs that a piece of code is probably more complicated than it needs to be."
  • "Beautiful designs reflect a balance between competing ideas and approaches. Several chapters have sections titled “Taking it too far,” which describe how to recognize when you are overdoing a good thing."
用户评论
值得五星推荐。软件设计经常是一个只可意会而难于言传的事情,作者用一本小书反复地讲出来,非常棒。书中许多道理在平时开发中已有所接触、谙于心扉,不过仍然有所收获。目前我们有许多同学写代码,但真正精于设计的同学却属凤毛麟角。我之前的一位师傅曾说过:写代码前要多思考、多设计,设计的时间要比写代码的时间多的多。诚然、良好设计的代码可以保证系统是简单的易于理解的、利于长期生长的、且健壮的。这是一门学问,是区分真正的技术高手和一般程序员的一个重要门槛。
下载
收藏