ACM Turing Lecture 1972.docx
《ACM Turing Lecture 1972.docx》由会员分享,可在线阅读,更多相关《ACM Turing Lecture 1972.docx(11页珍藏版)》请在冰豆网上搜索。
![ACM Turing Lecture 1972.docx](https://file1.bdocx.com/fileroot1/2023-1/10/f27f13d0-b74a-47f1-9c69-05c281daa05f/f27f13d0-b74a-47f1-9c69-05c281daa05f1.gif)
ACMTuringLecture1972
ACMTuringLecture1972
EWD340
TheHumbleProgrammer
by
EdsgerW.Dijkstra
AsaresultofalongsequenceofcoincidencesIenteredtheprogrammingprofessionofficiallyonthefirstspringmorningof1952andasfarasIhavebeenabletotrace,IwasthefirstDutchmantodosoinmycountry.Inretrospectthemostamazingthingwastheslownesswithwhich,atleastinmypartoftheworld,theprogrammingprofessionemerged,aslownesswhichisnowhardtobelieve.ButIamgratefulfortwovividrecollectionsfromthatperiodthatestablishthatslownessbeyondanydoubt.
Afterhavingprogrammedforsomethreeyears,IhadadiscussionwithA.vanWijngaarden,whowasthenmybossattheMathematicalCentreinAmsterdam,adiscussionforwhichIshallremaingratefultohimaslongasIlive.ThepointwasthatIwassupposedtostudytheoreticalphysicsattheUniversityofLeidensimultaneously,andasIfoundthetwoactivitiesharderandhardertocombine,Ihadtomakeupmymind,eithertostopprogrammingandbecomeareal,respectabletheoreticalphysicist,ortocarrymystudyofphysicstoaformalcompletiononly,withaminimumofeffort,andtobecome.....,yeswhat?
Aprogrammer?
Butwasthatarespectableprofession?
Forafterall,whatwasprogramming?
Wherewasthesoundbodyofknowledgethatcouldsupportitasanintellectuallyrespectablediscipline?
IrememberquitevividlyhowIenviedmyhardwarecolleagues,who,whenaskedabouttheirprofessionalcompetence,couldatleastpointoutthattheykneweverythingaboutvacuumtubes,amplifiersandtherest,whereasIfeltthat,whenfacedwiththatquestion,Iwouldstandempty-handed.FullofmisgivingsIknockedonvanWijngaarden'sofficedoor,askinghimwhetherIcould"speaktohimforamoment";whenIlefthisofficeanumberofhourslater,Iwasanotherperson.Forafterhavinglistenedtomyproblemspatiently,heagreedthatuptillthatmomenttherewasnotmuchofaprogrammingdiscipline,butthenhewentontoexplainquietlythatautomaticcomputerswereheretostay,thatwewerejustatthebeginningandcouldnotIbeoneofthepersonscalledtomakeprogrammingarespectabledisciplineintheyearstocome?
ThiswasaturningpointinmylifeandIcompletedmystudyofphysicsformallyasquicklyasIcould.Onemoraloftheabovestoryis,ofcourse,thatwemustbeverycarefulwhenwegiveadvicetoyoungerpeople;sometimestheyfollowit!
Anothertwoyearslater,in1957,ImarriedandDutchmarriageritesrequireyoutostateyourprofessionandIstatedthatIwasaprogrammer.ButthemunicipalauthoritiesofthetownofAmsterdamdidnotacceptitonthegroundsthattherewasnosuchprofession.And,believeitornot,butundertheheading"profession"mymarriageactshowstheridiculousentry"theoreticalphysicist"!
SomuchfortheslownesswithwhichIsawtheprogrammingprofessionemergeinmyowncountry.SincethenIhaveseenmoreoftheworld,anditismygeneralimpressionthatinothercountries,apartfromapossibleshiftofdates,thegrowthpatternhasbeenverymuchthesame.
Letmetrytocapturethesituationinthoseolddaysinalittlebitmoredetail,inthehopeofgettingabetterunderstandingofthesituationtoday.Whilewepursueouranalysis,weshallseehowmanycommonmisunderstandingsaboutthetruenatureoftheprogrammingtaskcanbetracedbacktothatnowdistantpast.
Thefirstautomaticelectroniccomputerswereallunique,single-copymachinesandtheywerealltobefoundinanenvironmentwiththeexcitingflavourofanexperimentallaboratory.Oncethevisionoftheautomaticcomputerwasthere,itsrealisationwasatremendouschallengetotheelectronictechnologythenavailable,andonethingiscertain:
wecannotdenythecourageofthegroupsthatdecidedtotryandbuildsuchafantasticpieceofequipment.Forfantasticpiecesofequipmenttheywere:
inretrospectonecanonlywonderthatthosefirstmachinesworkedatall,atleastsometimes.Theoverwhelmingproblemwastogetandkeepthemachineinworkingorder.Thepreoccupationwiththephysicalaspectsofautomaticcomputingisstillreflectedinthenamesoftheolderscientificsocietiesinthefield,suchastheAssociationforComputingMachineryortheBritishComputerSociety,namesinwhichexplicitreferenceismadetothephysicalequipment.
Whataboutthepoorprogrammer?
Well,totellthehonesttruth:
hewashardlynoticed.Foronething,thefirstmachinesweresobulkythatyoucouldhardlymovethemandbesidesthat,theyrequiredsuchextensivemaintenancethatitwasquitenaturalthattheplacewherepeopletriedtousethemachinewasthesamelaboratorywherethemachinehadbeendeveloped.Secondly,hissomewhatinvisibleworkwaswithoutanyglamour:
youcouldshowthemachinetovisitorsandthatwasseveralordersofmagnitudemorespectacularthansomesheetsofcoding.Butmostimportantofall,theprogrammerhimselfhadaverymodestviewofhisownwork:
hisworkderivedallitssignificancefromtheexistenceofthatwonderfulmachine.Becausethatwasauniquemachine,heknewonlytoowellthathisprogramshadonlylocalsignificanceandalso,becauseitwaspatentlyobviousthatthismachinewouldhavealimitedlifetime,heknewthatverylittleofhisworkwouldhavealastingvalue.Finally,thereisyetanothercircumstancethathadaprofoundinfluenceontheprogrammer'sattitudetohiswork:
ontheonehand,besidesbeingunreliable,hismachinewasusuallytooslowanditsmemorywasusuallytoosmall,i.e.hewasfacedwithapinchingshoe,whileontheotherhanditsusuallysomewhatqueerordercodewouldcaterforthemostunexpectedconstructions.Andinthosedaysmanyacleverprogrammerderivedanimmenseintellectualsatisfactionfromthecunningtricksbymeansofwhichhecontrivedtosqueezetheimpossibleintotheconstraintsofhisequipment.
Twoopinionsaboutprogrammingdatefromthosedays.Imentionthemnow,Ishallreturntothemlater.Theoneopinionwasthatareallycompetentprogrammershouldbepuzzle-mindedandveryfondofclevertricks;theotheropinonwasthatprogrammingwasnothingmorethanoptimizingtheefficiencyofthecomputationalprocess,inonedirectionortheother.
Thelatteropinionwastheresultofthefrequentcircumstancethat,indeed,theavailableequipmentwasapainfullypinchingshoe,andinthosedaysoneoftenencounteredthenaiveexpectationthat,oncemorepowerfulmachineswereavailable,programmingwouldnolongerbeaproblem,forthenthestruggletopushthemachinetoitslimitswouldnolongerbenecessaryandthatwasallwhatprogrammingwasabout,wasn'tit?
Butinthenextdecadessomethingcompletelydifferenthappened:
morepowerfulmachinesbecameavailable,notjustanorderofmagnitudemorepowerful,evenseveralordersofmagnitudemorepowerful.Butinsteadoffindingourselvesinthestateofeternalblissofallprogammingproblemssolved,wefoundourselvesuptoournecksinthesoftwarecrisis!
Howcome?
Thereisaminorcause:
inoneortworespectsmodernmachineryisbasicallymoredifficulttohandlethantheoldmachinery.Firstly,wehavegottheI/Ointerrupts,occurringatunpredictableandirreproduciblemoments;comparedwiththeoldsequentialmachinethatpretendedtobeafullydeterministicautomaton,thishasbeenadramaticchangeandmanyasystemsprogrammer'sgreyhairbearswitnesstothefactthatweshouldnottalklightlyaboutthelogicalproblemscreatedbythatfeature.Secondly,wehavegotmachinesequippedwithmulti-levelstores,presentingusproblemsofmanagementstrategythat,inspiteoftheextensiveliteratureonthesubject,stillremainratherelusive.Somuchfortheaddedcomplicationduetostructuralchangesoftheactualmachines.
ButIcalledthisaminorcause;themajorcauseis...thatthemachineshavebecomeseveralordersofmagnitudemorepowerful!
Toputitquitebluntly:
aslongastherewerenomachines,programmingwasnoproblematall;whenwehadafewweakcomputers,programmingbecameamildproblem,andnowwehavegiganticcomputers,programminghadbecomeanequallygiganticproblem.Inthissensetheelectronicindustryhasnotsolvedasingleproblem,ithasonlycreatedthem,ithascreatedtheproblemofusingitsproducts.Toputitinanotherway:
asthepowerofavailablemachinesgrewbyafactorofmorethanathousand,society'sambitiontoapplythesemachinesgrewinproportion,anditwasthepoorprogrammerwhofoundhisjobinthisexplodedfieldoftensionbetweenendsandmeans.Theincreasedpowerofthehardware,togetherwiththeperhapsevenmoredramaticincreaseinitsreliability,madesolutionsfeasiblethattheprogrammerhadnotdaredtodreamaboutafewyearsbefore.Andnow,afewyearslater,hehadtodreamaboutthemand,evenworse,hehadtotransformsuchdreamsintoreality!
Isitawonderthatwefoundourselvesinasoftwarecrisis?
No,certainlynot,andasyoumayguess,itwasevenpredictedwellinadvance;butthetroublewithminorprophets,ofcourse,isthatitisonlyfiveyearslaterthatyoureallyknowthattheyhadbeenright.
Then,inthemid-sixties,somethingterriblehappened:
thecomputersoftheso-calledthirdgenerationmadetheirappearance.Theofficialliteraturetellsusthattheirprice/performanceratiohasbeenoneofthemajordesignobjectives.Butifyoutakeas"performance"thedutycycleofthemachine'svariouscomponents,littlewillpreventyoufromendingupwithadesigninwhichthemajorpartofyourperformancegoalisreachedbyinternalhousekeepingactivitiesofdoubtfulnecessity.Andifyourdefinitionofpriceisthepricetobepaidforthehardware,littlewillpreventyo