智力低下的程序员.docx
- 文档编号:16431787
- 上传时间:2023-07-13
- 格式:DOCX
- 页数:15
- 大小:28.44KB
智力低下的程序员.docx
《智力低下的程序员.docx》由会员分享,可在线阅读,更多相关《智力低下的程序员.docx(15页珍藏版)》请在冰点文库上搜索。
智力低下的程序员
TheHumbleProgrammer
by
EdsgerW.Dijkstra
AsaresultofalongsequenceofcoincidencesIenteredtheprogrammingprofessionofficiallyonthefirstspringmorningof1952andasfarasIhavebeenabletotrace,IwasthefirstDutchmantodosoinmycountry.Inretrospectthemostamazingthingwastheslownesswithwhich,atleastinmypartoftheworld,theprogrammingprofessionemerged,aslownesswhichisnowhardtobelieve.ButIamgratefulfortwovividrecollectionsfromthatperiodthatestablishthatslownessbeyondanydoubt.
Afterhavingprogrammedforsomethreeyears,IhadadiscussionwithA. vanWijngaarden,whowasthenmybossattheMathematicalCentreinAmsterdam,adiscussionforwhichIshallremaingratefultohimaslongasIlive.ThepointwasthatIwassupposedtostudytheoreticalphysicsattheUniversityofLeadensimultaneously,andasIfoundthetwoactivitiesharderandhardertocombine,Ihadtomakeupmymind,eithertostopprogrammingandbecomeareal,respectabletheoreticalphysicist,ortocarrymystudyofphysicstoaformalcompletiononly,withaminimumofeffort,andtobecome.....,yeswhat?
Aprogrammer?
Butwasthatarespectableprofession?
Forafterall,whatwasprogramming?
Wherewasthesoundbodyofknowledgethatcouldsupportitasanintellectuallyrespectablediscipline?
IrememberquitevividlyhowIenviedmyhardwarecolleagues,who,whenaskedabouttheirprofessionalcompetence,couldatleastpointoutthattheykneweverythingaboutvacuumtubes,amplifiersandtherest,whereasIfeltthat,whenfacedwiththatquestion,Iwouldstandempty-handed.FullofmisgivingsIknockedonvanWeingarten’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-copymachinesandtheywerealltobefoundinanenvironmentwiththeexcitingflavorofanexperimentallaboratory.Oncethevisionoftheautomaticcomputerwasthere,itsrealizationwasatremendouschallengetotheelectronictechnologythenavailable,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,littlewillpreventyoufromendingupwthadesignthatisterriblyhardto
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 智力 低下 程序员