您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 信息化管理 > Programming Languages.ppt
1CS101IntroductiontoComputingLecture19ProgrammingLanguages2Duringthelastlecture…•Wecontinuedourdiscussiononalgorithmsthatwehadstartedduringthe16thlecture•Inparticular,welookedatthebuildingblocksthatareusedinallalgorithms•Wealsodiscussedthepseudocodeandflowchartsforparticularproblems•Inaddition,weoutlinedtheprosandconsofthosetwotechniques3LasttimewediscussedwhattoimplementTodaywearegoingtodiscussthetoolthatisusedtoimplementSW4Today’sLecture•Tounderstandtheroleofprogramminglanguagesincomputing•Tounderstandthedifferencesamonglow-&high-level,interpreted&compiled,andstructured&object-orientedprogramminglanguages5Programming?6TheprocessoftellingthecomputerwhattodoAlsoknownascoding7TypesofPrograms?8BatchProgramsThesearetypicallystartedfromashell(orautomaticallyviaascheduler)andtendtofollowapatternof:–Initializeinternaldata–Readinputdata–Processthatdata–PrintorstoreresultsKeyfeature:NouserinteractionwiththecomputerwhiletheprogramisrunningExamples?9Event-DrivenProgramsExamples?GUIs,microwave,cameraThesystemsendseventstotheprogramandtheprogramrespondstotheseastheyarrive.Eventscanincludethingsauserdoes-likeclickingthemouse-orthingsthatthesystemitselfdoes-likeupdatingtheclock.Theseprogramsgenerallyworkasfollows:–Initializetheinternaldata–Waitforeventstoarrive–Identifyanincomingeventandreactaccordingly10ProgrammingLanguage?11Avocabularyandsetofgrammaticalrulesforinstructingacomputertoperformspecifictasks12Allprogramsconsistsof:1.Sequenceofinstructions2.Conditionals3.LoopsThesemaycontain:–Data–Input/output(print,etc)–Operations(add,divide,etc)13ExamplesofProgrammingLanguage?14MachineLanguageAssemblyLanguage(1956-63)LISP(1956)Fortran(1957)COBOL(1959)PL/1(1964)BASIC(1964)Pascal(1970)Smalltalk(1972)C(1972)Ada(1983)C++(1983-85)QBasic(1986)Perl(1987)VisualBasic(1991)PowerBuilderJava(1995)JavaScriptC#(2001)15IsHTMLaprogramminglanguage?16TypesofProgrammingLanguages?17HighlevelProgrammingLanguagesLowLevelProgrammingLanguages18High-levelprogramminglanguages,whilesimplecomparedtohumanlanguages,aremorecomplexthanthelanguagestheuPactuallyunderstands,calledmachinelanguagesEachdifferenttypeofuPhasitsownuniquemachinelanguage19Lyingbetweenmachinelanguages&high-levellanguagesarelanguagescalledassemblylanguages20Assemblylanguagesaresimilartomachinelanguages,butareeasiertoprograminastheyallowaprogrammertosubstitutenamesfornumbersMachinelanguagesconsistofnumbersonly214th-generationlanguagesHigh-levellanguagesAssemblylanguagesMachinelanguages2223Regardlessofwhatlanguageyouuse,youeventuallyneedtoconvertyourprogramintoalanguagethatthecomputercanunderstandTwowaysfordoingthat:compiletheprogramorinterprettheprogram24Interpreterisaprogramthatexecutesinstructionswritteninahigh-levellanguageAninterpretertranslateshigh-levelinstructionsintoanintermediateform,whichitthenexecutesIncontrast,acompilertranslateshigh-levelinstructionsdirectlyintomachinelanguage25CompiledprogramsgenerallyrunfasterthaninterpretedprogramsTheadvantageofaninterpreter,however,isthatitdoesnotneedtogothroughthecompilationstageduringwhichthewholeofthehigh-levelcodeistranslatedintomachineinstructionsinonego.Thisprocesscanbetime-consumingiftheprogramislong.Theinterpretercanimmediatelyexecutehigh-levelprograms,withoutwaitingforthecompletionofthetranslationprocess26Interpreters:Immediateresponse,butexecutecodeslowlyCompilers:Takeslongertocompile,butsuper-fastexecution27Bothinterpretersandcompilersareavailableformosthigh-levellanguages.However,BASICandLISPwereespeciallydesignedtobeexecutedbyaninterpreter28Whyaretheresomanydifferentprogramminglanguages?29Whatisthedifferencebetweenthem?3031Whataretheadvantagesofparticularlanguages?3233ThequestionofwhichlanguageisbestisonethatconsumesalotoftimeandenergyamongcomputerprofessionalsEverylanguagehasitsstrengthsandweaknesses34FORTRANisaparticularlygoodlanguageforprocessingnumericaldata,butitdoesnotlenditselfverywelltolargebusinessprogramsPascalisverygoodforwritingwell-structuredandreadableprograms,butitisnotasflexibleastheCprogramminglanguageC++embodiespowerfulobject-orientedfeatures,butitiscomplexanddifficulttolearn35Thechoiceofwhichlanguagetousecanalsodependonthe:typeofcomputertheprogramistorunon,andtheexpertiseoftheprogrammer36Canasinglelanguagehaveallthegoodbitsofotherlanguages?37Dosomegoodfeaturesforcealanguagetoalsohavebadfeatures?38Whatmakesafeaturegoodorbad?39Isthereaperfectlanguage?40Isthereaperfectlanguageforaparticulartask?41Whatchangesinthefieldofcomputerlanguagescanweexpectinthenearfuture?42Whichprogramminglanguageshouldyoulearn?Shouldyoulearnmorethanone?43ProgrammingDevelopment44SWDesignMethodology?45Thesetof(oftenflexible)rulesandguidelinesateamofdevelopersfollowtoconstructreasonablycomplexSWsystems46ObjectOrientedDesign(1)•OOSWisallaboutobjects:ablackboxwhichreceivesmessages&respondswiththoseofitsown•Anobjecthas2aspects:–State,alsotermedasproperties,data•Example:Forthebicycle:color,speed,pressure–Behaviors,alsotermedasmethods,instructions•Example:Forthesameobject:accelerate(),inflate()•Intraditionaldesign,these2aspectshavebeenkep
本文标题:Programming Languages.ppt
链接地址:https://www.777doc.com/doc-1916949 .html