《計算機專業英語》謝希仁第二版-第7章講義_第1頁
《計算機專業英語》謝希仁第二版-第7章講義_第2頁
《計算機專業英語》謝希仁第二版-第7章講義_第3頁
《計算機專業英語》謝希仁第二版-第7章講義_第4頁
《計算機專業英語》謝希仁第二版-第7章講義_第5頁
已閱讀5頁,還剩32頁未讀 繼續免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

會計學1《計算機專業英語》謝希仁第二版-第7章講義Keypoints:

usefultermsanddefinitionsofprogramminglanguages

Difficultpoints:

describingthedifferencesbetweencompilersandinterpreters第1頁/共37頁Requirements:TheoriginsoftheprogramminglanguagesTheconceptsofcomputercompilersMainpropertiesofobject-orientation掌握復雜定語從句的翻譯技巧第2頁/共37頁NewWords&Expressions:translatorn.翻譯器,翻譯程序 syntaxn.語法,句法machinelanguage機器語言 assemblylanguage匯編語言abbreviatev.縮短,縮寫 compilev.編譯interpretv.解釋

7.1IntroductiontoProgrammingLanguageAbbreviations:OOPL(object-orientedprogramminglanguage)面向對象的程序設計語言第3頁/共37頁Aprogramminglanguagerepresentsaspecialvocabularyandasetofgrammaticalrulesforinstructingacomputertoperformspecifictasks.Broadlyspeaking,itconsistsofasetofstatementsorexpressionsunderstandabletobothpeopleandcomputers.7.1IntroductiontoProgrammingLanguage程序設計語言是指令計算機實現某些具體任務的一套特殊詞匯和一組語法規則。從廣義的角度說,它包括一組既能被人所理解又能被計算機所識別的聲明和表達式。第4頁/共37頁Peopleunderstandtheseinstructionsbecausetheyusehuman(Englishandmathematical)expressions.Computers,ontheotherhand,processtheseinstructionsthroughuseofspecialprograms,which,knownastranslators,decodetheinstructionsfrompeopleandcreatemachine-languagecoding.為人們所能理解是因為它們使用的是人類的(英文和數學的)表達方式。另一方面,計算機通過使用專門的程序來處理這些指令,這些專門的程序就是我們所熟知的翻譯程序,它能解碼我們發出的指令并生成機器語言代碼。7.1IntroductiontoProgrammingLanguage第5頁/共37頁Thetermprogramminglanguageusuallyreferstohigh-levellanguages,suchasBASIC,C,C++,COBOL,FORTRAN,AdaandPascal.Eachlanguagehasauniquesetofkeywords(wordsthatitunderstands)andaspecialsyntaxfororganizingprograminstructions.所謂程序設計語言通常是指高級語言,像BASIC,C,C++,COBOL,FORTRAN,Ada和Pascal。每種語言都具有一套獨特的關鍵字(它能理解的字)和組織程序指令的專門語法。7.1IntroductiontoProgrammingLanguage第6頁/共37頁High-levelprogramminglanguages,whilesimplecomparedtohumanlanguages,aremorecomplexthanthelanguagesthecomputeractuallyunderstands,whicharecalledmachinelanguages.EachdifferenttypeofCPU(CentralProcessingUnit)hasitsownuniquemachinelanguage.簡單地與人類語言相比,高級程序設計語言比計算機實際識別的語言,也就是機器語言,復雜得多。不同型號的CPU(中央處理單元)都有它獨自的一套機器語言。7.1IntroductiontoProgrammingLanguage第7頁/共37頁Lyingbetweenmachinelanguagesandhigh-levellanguagesareassemblylanguages,whicharedirectlyrelatedtoacomputer’smachinelanguage.Inotherwords,ittakesoneassemblycommandtogenerateeachmachine-languagecommand.Machinelanguagesconsistentirelyofnumbersandarealmostimpossibleforhumanstoreadandwrite.Assemblylanguageshavethesamestructureandsetofcommandsasmachinelanguages,buttheyenableaprogrammertousenamesinsteadofnumbers.處于機器語言和高級語言之間的是匯編語言,它直接與機器語言相關;也就是說,它可將一個匯編指令生成一個機器語言指令。人們幾乎不可能去讀和寫那些只包含數字的機器語言。雖然匯編語言具有和機器語言相同的結構和命令集,但是編程人員可以使用助記符來代替數字。7.1IntroductiontoProgrammingLanguage第8頁/共37頁EachtypeofCPUhasitsownmachinelanguageandassemblylanguage,soanassemblylanguageprogramwrittenforonetypeofCPUwon’trunonanother.Intheearlydaysofprogramming,allprogramswerewritteninassemblylanguages.Now,mostprogramsarewritteninahigh-levellanguagesuchasFORTRANorC.Programmersstilluseassemblylanguageswhenspeedisessentialorwhentheyneedtoperformanoperationthatisn’tpossibleinahigh-levellanguage.每種類型的CPU都有它自身的機器語言和匯編語言,因此為一種CPU編寫的匯編語言不能運行于其它的CPU之上。在程序設計的早期,所有的程序都是用匯編語言編寫的。而現在,大部分程序都是用像FORTRAN或C這樣的高級程序編寫的。但當對運行速度要求很高,或執行一個高級語言無法處理的操作時,編程人員仍舊會選擇匯編語言。7.1IntroductiontoProgrammingLanguage第9頁/共37頁Lyingabovehigh-levellanguagesarethosecalledfourth-generationlanguages(usuallyabbreviated4GL).4GLsarefarremovedfrommachinelanguagesandrepresenttheclassofcomputerlanguagesclosesttohumanlanguages.Most4GLsareusedtoaccessdatabases.Forexample,atypical4GLcommandis:FINDALLRECORDSWHERENAMEIS“SMITH”.位于高級語言之上的是第四代程序設計語言(簡稱4GL),它與機器語言差異更大,代表了與人類語言更為接近的那類計算機程序設計語言。大多數4GL被用于進行訪問數據庫的操作。例如,一條典型的4GL是:FINDALLRECORDSWHERENAMEIS“SMITH”(查找所有記錄中姓名是“SMITH”的記錄)。7.1IntroductiontoProgrammingLanguage第10頁/共37頁Morerecently,anewtypeofprogramminglanguagehasemergedthatsupportsObjectOrientedProgramming(OOP),includingC++,MicrosoftVisualC++,VisualFoxpro,andVisualJava.OOPisatypeofprogramminginwhichprogrammersdefinenotonlythedatatypeofadatastructure,butalsothetypesofoperations(functions,ormethods)thatcanbeappliedtothedatastructure.近來出現的新的程序設計語言,像C++,微軟的VisualC++,VisualFoxpro,和VisualJava,他們都支持面向對象的程序設計(OOP)技術。OOP這種程序設計要求編程人員不僅要給出數據結構中的數據類型的定義,還需要給出作用在這些數據結構之上的操作(函數,或方法)的類型。7.1IntroductiontoProgrammingLanguage第11頁/共37頁Inthisway,thedatastructurebecomesanobjectthatincludesbothdataandfunctions.Inaddition,programmerscancreaterelationshipsbetweenoneobjectandanother.Forexample,objectscaninheritcharacteristicsfromotherobjects.Oneoftheprincipaladvantagesofobject-orientedprogrammingtechniquesoverproceduralprogrammingtechniquesisthattheyenableprogrammerstocreatemodulesthatdonotneedtobechangedwhenanewtypeofobjectisadded.這樣,可使得數據結構成為一個既包含數據又包含函數的對象。此外,編程人員可以創建對象間的關系,例如,一個對象可以繼承其它對象的一些特性。相對于過程式的程序設計技術,面向對象的程序設計技術的一個主要優點是:當創建一個新類型的對象時,已有的模塊不需要發生改變。7.1IntroductiontoProgrammingLanguage第12頁/共37頁Aprogrammercansimplycreateanewobjectthatinheritsmanyofitsfeaturesfromexistingobjects.Thismakesobject-orientedprogramseasiertomodify.Toperformobject-orientedprogramming,oneneedsanobject-orientedprogramminglanguage(OOPL).C++andSmalltalkaretwoofthemorepopularlanguages,andtherearealsoobject-orientedversionsofPascal.編程人員可以很方便地創建一個新對象,使它的許多特征繼承于已存在對象,這使得面向對象的程序更容易修改。為了運行面向對象的程序設計,需要一種面向對象的程序設計語言(OOPL)。C++和Smalltalk是其中最流行的兩種語言,當然也有Pascal的面向對象的版本。7.1IntroductiontoProgrammingLanguage第13頁/共37頁Allhigh-levellanguageprogramsmustbetranslatedintomachinelanguagesothatthecomputercanunderstandit.Therearetwowaystodothis:compiletheprogramorinterprettheprogram.所有的高級語言程序只有在翻譯成機器語言后,才能被計算機執行。翻譯有兩種方式:編譯和解釋。

7.1IntroductiontoProgrammingLanguage第14頁/共37頁Thequestionofwhichlanguageisbestisonethatconsumesalotoftimeandenergyamongcomputerprofessionals.Everylanguagehasitsstrengthsandweaknesses.Forexample,FORTRANisaparticularlygoodlanguageforprocessingnumericaldata,butitdoesnotlenditselfverywelltoorganizinglargeprograms.到底哪種語言最好是一個困擾業界專家很長時間和消耗他們很多精力的問題。每種語言都各有優劣,例如,像FORTRAN語言,適合于處理數值計算,但卻不適合組織大規模的程序。7.1IntroductiontoProgrammingLanguage第15頁/共37頁Pascalisverygoodforwritingwell-structuredandreadableprograms,butitisnotasflexibleastheCprogramminglanguage.C++embodiespowerfulobject-orientedfeatures,butitiscomplexanddifficulttolearn.Thechoiceofwhichlanguagetousedependsonthetypeofcomputertheprogramistorunon,whatsortprogramitis,andtheexpertiseoftheprogrammer.Pascal語言是一種結構化的語言,程序可讀性強,但卻不具備C語言的靈活性。C++嵌入了功能強大的面向對象特性,但是它卻復雜難學。具體選擇使用哪一種語言依賴于程序運行的計算機類型,程序的種類,和編程人員的專長。7.1IntroductiontoProgrammingLanguage第16頁/共37頁Thetrendtowardhigher-levellanguages,initiatedinthe1950s,isstillcontinuing.Today,thereistalkaboutnaturallanguagecommunicationbetweenpeopleandcomputers.Thatis,toolsarebeingdevelopedtomakeitpossibleforpeopletoaddresscomputersinnormal,conversationallanguage.Bothwrittenandspokenversionofnaturallanguagesisinuse.However,agreatdealofdevelopmentaleffortremainsbeforetheselanguagesbecomecommoninbusinessapplications.

設計更高級的語言的趨勢始于20世紀50年代并一直進行到了現在。如今,人們在探討人與計算機之間進行自然語言的交流;也就是說,正在研制的工具使得人們可以用正常的、口語式的語言同計算機講話,不論是書面的形式還是口頭的形式。然而,要想這些語言能在商業廣泛應用,還需要做很多努力。7.1IntroductiontoProgrammingLanguage第17頁/共37頁Object-orientedprogramming(OOP)isaprogramminglanguagemodelorganizedaround"objects"ratherthan"actions"anddataratherthanlogic.Historically,aprogramhasbeenviewedasalogicalprocedurethattakesinputdata,processesit,andproducesoutputdata.Theprogrammingchallengewasseenashowtowritethelogic,nothowtodefinethedata.面向對象的程序設計是一種以面向“對象”的,而不是“行為”的,面向數據而不是邏輯的方式組織的程序設計語言模式。曾經,程序被認為是接收輸入數據、處理、產生輸出數據的一個邏輯過程。7.2Object-orientedProgramming第18頁/共37頁Object-orientedprogrammingtakestheviewthatwhatwereallycareaboutaretheobjectswewanttomanipulateratherthanthelogicrequiredtomanipulatethem.Examplesofobjectsrangefromhumanbeings(describedbyname,address,andsoforth)tobuildingsandfloors(whosepropertiescanbedescribedandmanaged)downtothelittlewidgetsonyourcomputerdesktop(suchasbuttonsandscrollbars).編程的困難在于如何寫出邏輯關系,而不是如何定義數據。而面向對象的程序設計認為,我們真正關心的是我們所能操作的對象而不是操作它們所要求的邏輯關系,比如說,從人(由姓名、地址,等等來描述)到建筑物和樓層(可由它的特征來描述和管理),再到你的計算機桌面上的小控件(像按鈕和滾動塊)。7.2Object-orientedProgramming第19頁/共37頁ThefirststepinOOPistoidentifyalltheobjectsyouwanttomanipulateandhowtheyrelatetoeachother,anexerciseoftenknownasdatamodeling.Onceyou'veidentifiedanobject,yougeneralizeitasaclassofobjects(thinkofPlato'sconceptofthe"ideal"chairthatstandsforallchairs)anddefinethekindofdataitcontainsandanylogicsequencesthatcanmanipulateit.面向對象的程序設計的第一步就是要確定你需要操作的所有實體和它們之間的聯系,一個為人熟知的操作就是數據建模。一旦你定義了一個對象,你將它概括為一個對象的類(試想,柏拉圖給出的“完美”椅子的概念代表了所有的椅子)并定義了這個類所包含的數據和所有可操作的邏輯順序。7.2Object-orientedProgramming第20頁/共37頁Eachdistinctlogicsequenceisknownasamethod.Arealinstanceofaclassiscalled(nosurprisehere)an"object"or,insomeenvironments,an"instanceofaclass."Theobjectorclassinstanceiswhatyouruninthecomputer.Itsmethodsprovidecomputerinstructionsandtheclassobjectcharacteristicsproviderelevantdata.Youcommunicatewithobjects-andtheycommunicatewitheachother-withwell-definedinterfacescalledmessages.每一個明確的邏輯過程就叫做方法。一個類的示例(這里毫不奇怪地)叫做一個“對象”,有時也叫做“一個類的示例”。機器上運行的就是對象或類的示例。其中,方法給計算機提供指令,類和對象的特征提供相關的數據。你可以和對象交流,而對象之間通過定義好的接口,也稱為消息,進行交流。7.2Object-orientedProgramming第21頁/共37頁Theconceptsandrulesusedinobject-orientedprogrammingprovidetheseimportantbenefits:面向對象的程序設計中的概念和規則具有下面這樣一些重要的優點:Theconceptofadataclassmakesitpossibletodefinesubclassesofdataobjectsthatsharesomeorallofthemainclasscharacteristics.Calledinheritance,thispropertyofOOPforcesamorethoroughdataanalysis,reducesdevelopmenttime,andensuresmoreaccuratecoding.數據類的概念使得定義的子類可以部分地或全部地共享父類的特征。這稱之為繼承。OOP的這種特性要求必須深入的分析數據,減少研發的時間,確保更準確的編碼。7.2Object-orientedProgramming第22頁/共37頁Sinceaclassdefinesonlythedataitneedstobeconcernedwith,whenaninstanceofthatclass(anobject)isrun,thecodewillnotbeabletoaccidentallyaccessotherprogramdata.Thischaracteristicofdatahidingprovidesgreatersystemsecurityandavoidsunintendeddatacorruption.由于一個類只需定義與之相關的數據,當這個類的一個實例(對象)運行時,它的代碼不能突然去訪問其它程序的數據。這種數據的隱藏性提供給系統更強的安全性,也避免了非故意的數據破壞。7.2Object-orientedProgramming第23頁/共37頁Thedefinitionofaclassisreuseablenotonlybytheprogramforwhichitisinitiallycreatedbutalsobyotherobject-orientedprograms(and,forthisreason,canbemoreeasilydistributedforuseinnetworks).一個類的定義不僅可為最初創建它的程序再使用,也可以被其它的面向對象程序使用(也正是這個原因,類適用于分布式網絡)。Theconceptofdataclassesallowsaprogrammertocreateanynewdatatypethatisnotalreadydefinedinthelanguageitself.編程人員利用數據類的概念可以創建任何計算機語言中沒有定義過的數據類型。7.2Object-orientedProgramming>>第24頁/共37頁Oneofthefirstobject-orientedcomputerlanguageswascalledSmalltalk.C++andJavaarethemostpopularobject-orientedlanguagestoday.TheJavaprogramminglanguageisdesignedespeciallyforuseindistributedapplicationsoncorporatenetworksandtheInternet.

Smalltalk是最早的面向對象的計算機語言之一,而如今最流行的面向對象語言是C++和Java。Java語言最適用于私網和因特網上的分布式應用。7.2Object-orientedProgramming第25頁/共37頁三、解環法這種方法適用于翻譯“連環式”后置定語或定語從句,也就是當原文中的一個中心詞(組)被若干個定語(從句)一環扣一環地修飾時,可先將中心詞(組)譯出,或把中心詞(組)與靠近它的一個或兩個后置定語(從句)譯成漢語偏正詞組,然后順著“修飾環”依次翻譯其余成分。采用這種方法譯出的句子層次分明,脈絡清楚。由于科技英語中“連環式”修飾語出現較多,所以“解環法”具有較大的實用價值。復雜定語(從句)的翻譯技巧之二

第26頁/共37頁三、解環法例如:Aflightsimulatorisaperfectexampleofprogramsthatcreateavirtualreality,orcomputer-generated“reality”inwhichtheuserdosenotmerelywatchbutisabletoactuallyparticipate.飛行模擬器是創造虛擬現實的程序的一個完美例子,或者也可以叫它計算機生成的“現實”,在這個“現實”中,用戶不僅能看,而且能實際參與。(比較:飛行模擬器是創造虛擬現實,或者也可以叫它計算機生成的,用戶不僅能看,而且能實際參與的“現實”的程序的一個完美例子。)復雜定語(從句)的翻譯技巧之二

第27頁/共37頁復雜定語(從句)的翻譯技巧之二三、解環法再如:Object-orienteddatabasesstoreandmanipulatemorecomplexdatastructures,called“object”,whichareorganizedintohierarchicalclassesthatmayinheritpropertiesfromclasseshigherinthechain;thisdatabasestructureisthemostflexibleandadaptable.面向對象的數據庫可以存儲并處理更加復雜的數據結構,這種數據結構稱為“對象”,“對象”可以按層次組成“類”,低層的“類”可以繼承上層“類”的屬性;這是一種最靈活,最具適應性的數據結構。(比較:面向對象的數據庫可以存儲并處理更加復雜的、稱為“對象”的,可以按層次組成“類”的,低層的“類”可以繼承上層“類”屬性的數據結構;這是一種最靈活,最具適應性的數據結構。)第28頁/共37頁復雜定語(從句)的翻譯技巧之二三、解環法在英語科技文獻中,對于某些連環式修飾語,有時還需同時借助“先提后敘法”,才能使語句順暢。例如:It(chapter2)providesnumeroussolutionsforprotectingproblemsassociatedwithanytypeofinstrumentsusingmicroprocessorsthatmustbeprotectedwhenvoltagesupplyfluctuates.此句屬連環式修飾。由于各個修飾環扣得很緊——原文中,protectingproblems并非僅僅與associatedwith…instruments有關,(定語從句本身帶有一個較長的狀語)。第29頁/共37頁復雜定語(從句)的翻譯技巧之二三、解環法因此,譯成漢語時:為了使修飾成分緊扣修飾對象,既不宜直接譯成偏正詞組——這會造成“大肚子”句,見譯文(1);也不宜用“解環法”法逐個翻譯修飾環——這會導致修飾語與中心詞關系松弛,見譯文(2);此時可采用“解環法+先提后敘法”,也就是先譯出一兩個修飾環,再用“這樣的”、“這樣一些”等詞語“扣”住中心詞,最后敘述具體修飾內容。這樣,不但句子修飾關系明確,而且行文較為流暢,見譯文(3)。(1)第二章提供與使用當供電電壓波動時必須加以保護的微處理器的任何類型儀器有關的保護問題的許多解決辦法。(2)第二章提供與任何類型儀器有關的保護問題的許多保護辦法,這類儀器使用微處理器,這些微處理器當供電電壓波動時必須予以保護。(3)第二章提供解決某些保護問題的許多辦法,這些保護問題與任何使用這樣一些微處理器的儀器有關:當供電電壓波動時時,必須予以保護。第30頁/共37頁復雜定語(從句)的翻譯技巧之二三、解環法例.Thisisasoftwareofflightsimulatorrunningonpersonalcomputers,intendedprimarilyforcomputer-aidedinstructionwhichrequiresprovidingpracticenavigationandinstrumentsreadingwhileusersimmerseinthevirtualenvironment.這個句子中的修飾關系也是“連環式”。由于某些修飾環(如

of…和running…,intended…

和which…)扣得緊,加上which引導的定語從句本身含有一個

while引導的狀語從句,所以此句也適于采用“解環法+先提后敘法”。全句可譯為:這是一個運行于個人計算機的飛行模擬器軟件,這種軟件主要用于如下計算機輔助教學:當用戶投入虛擬環境時,它必須提供導航和儀表讀數。由此可見,翻譯“連環式”修飾成分要因句制宜,靈活處理,不能只著眼于表面的修飾關系,還要考慮“修飾環”之間的緊密程度。通常,如果“修飾環”彼此關系較松,適于采用“解環法”;要是“扣”得很緊,則可采用“解環法+先提后敘法”。第31頁/共37頁四、句子結構調整法有時,原文句中一個中心詞帶有若干修飾成分,但:它們既不是純“并列”頭系,也不是規則的“連環”關系,而是“并列”中有“連環”(例1);或者“連環”中含不規則“修飾環”(例2);或者句中各有一個分別被“連環式”定語和“并列式”定語所修飾的中心詞(例3);或者中心詞的定語從句本身又含有其他修

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論