资源描述:
《Structured Programming with go to Statements》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、StructuredProgrammingwithgotoStatementsDONALDE.KNUTHStanfordUniversity,Stanford,California9~S05Aconsiderationofseveraldifferentexamplesshedsnewlightontheproblemofereat-ingreliable,well-structuredprogramsthatbehaveefficiently.Thisstudyfocuseslargelyontwoissues:(a)improvedsy
2、ntaxforiterationsanderrorexits,makingitpossibletowritealargerclassofprogramsclearlyandefficientlywithoutgotostate-ments;(b)amethodologyofprogramdesign,beginningwithreadableandcorrect,butpossiblyinefficientprogramsthataresystematicallytransformedifnecessaryintoefficientandc
3、orrect,butpossiblylessreadablecode.Thediscussionbringsoutop-posingpointsofviewaboutwhetherornotgotostatementsshouldbeabolished;somemeritisfoundonbothsidesofthisquestion.Fina!ly,anattemptismadetodefinethetruenatureofstructuredprogramming,andtorecommendfruitfuldirec-tionsfor
4、furtherstudy.Keywordsandphrases:structuredprogramming,gotostatements,languagedesign,eventindicators,recursion,Booleanvariables,iteration,optimizationofprograms,programtransformations,programmanipulationsystemssearching,Quieksort,efficiencyCRcategories:4.0,4.10,4.20,5.20,5.
5、5,6.1(5.23,5.24,5.25,5.27)Youmaygowhenyouwillgo,AndIwillstaybehind.--EdnaSt.VincentMillay[66]MostlikelyyougoyourwayandI'llgomine.--SongtitlebyBobDylan[33]Doyousufferfrompainfulelimination?--Advertisement,J.B.WilliamsCo.INTRODUCTIONchangeyourlife.Thereasonsforthisrevolu-tio
6、nanditsfutureprospectshavebeenaptlyArevolutionistakingplaceinthewaywedescribedbyE.W.Dijkstrainhis1972Tur-writeprogramsandteachprogramming,be-ingAwardLecture,"TheHumbleProgram-causewearebeginningtounderstandthemer"[27l.associatedmentalprocessesmoredeeply.ItAsweexperiencethi
7、srevolution,eachofisimpossibletoreadtherecentbookStruc-usnaturallyisdevelopingstrongfeelingsoneturedprogramming[17;55]withouthavingitwayortheother,asweagreeordisagreeThisresearchwassupportedinpartbytheNa-withtherevolutionaryleaders.ImustadmittionalScienceFoundationundergra
8、ntnumberGJ36473X,andbyIBMCorporation.tobeinganomhumbleprogrammer,egotisti-Copyright(~)197