A Philosophy of Software Design

A Philosophy of Software Design

作者:John Ousterhout

出版社:Yaknyam Press

出版年:2018-4-6

评分:9.2

ISBN:9781732102200

所属分类:行业好书

书刊介绍

内容简介

This book addresses the topic of software design: how to decompose complex software systems into modules (such as classes and methods) that can be implemented relatively independently. The book first introduces the fundamental problem in software design, which is managing complexity. It then discusses philosophical issues about how to approach the software design process, and it presents a collection of design principles to apply during software design. The book also introduces a set of red flags that identify design problems. You can apply the ideas in this book to minimize the complexity of large software systems, so that you can write software more quickly

作者简介

John Ousterhout is the Bosack Lerner Professor of Computer Science at Stanford University. His current research focuses on new software stack layers to allow datacenter applications to take advantage of communication and storage technologies with microsecond-scale latencies. Ousterhout's prior positions include 14 years in industry, where he founded two companies (Scriptics and...

(展开全部)

精彩摘录

APhilosophyofSoftwareDesignPreface-Themostfundamentalproblemincomputerscienceisproblemdecomposition:howtotakeacomplexproblemanddivideitupintopiecesthatcanbesolvedindependently.1Introduction###1.1Howtousethisbook-Thebestwaytousethisbookisinconjunctionwithcodereviews.-Oneofthebestwaystoimproveyourdesignskillsistolearntorecognizeredflags:signsthatapieceofcodeisprobablymorecomplicatedthanitneedstobe.-Whenapplyingtheideasfromthisbook,it’simportanttousemoderationanddiscretion.-Thismeansthatthegreatestlimitationinwritingsoftwareisourabilitytounderstandthesystemswearecreating.-Therearetwogeneralapproachestofightingcomplexity,bothofwhichwillbediscussedinthisbo...

——引自第1页


ThebestwaytoeliminateexceptionhandlingcomplexityistodefineyourAPIssothattherearenoexceptionstohandle:defineerrorsoutofexistence.Thismayseemsacrilegious,butitisveryeffectiveinpractice.ConsidertheTclunsetcommanddiscussedabove.Ratherthanthrowinganerrorwhenunsetisaskedtodeleteanunknownvariable,itshouldhavesimplyreturnedwithoutdoinganything.Ishouldhavechangedthedefinitionofunsetslightly:ratherthandeletingavariable,unsetshouldensurethatavariablenolongerexists.Withthefirstdefinition,unsetcan’tdoitsjobifthevariabledoesn’texist,sogeneratinganexceptionmakessense.Withtheseconddefinition,itisperfectlynaturalforunsettobeinvokedwiththenameofavariablethatdoesn’texist.Inthis...

——引自第88页

相关推荐

微信二维码