c#外文文献以及翻译Word格式.docx

上传人:b****3 文档编号:15064912 上传时间:2022-10-27 格式:DOCX 页数:5 大小:19.48KB
下载 相关 举报
c#外文文献以及翻译Word格式.docx_第1页
第1页 / 共5页
c#外文文献以及翻译Word格式.docx_第2页
第2页 / 共5页
c#外文文献以及翻译Word格式.docx_第3页
第3页 / 共5页
c#外文文献以及翻译Word格式.docx_第4页
第4页 / 共5页
c#外文文献以及翻译Word格式.docx_第5页
第5页 / 共5页
亲,该文档总共5页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

c#外文文献以及翻译Word格式.docx

《c#外文文献以及翻译Word格式.docx》由会员分享,可在线阅读,更多相关《c#外文文献以及翻译Word格式.docx(5页珍藏版)》请在冰豆网上搜索。

c#外文文献以及翻译Word格式.docx

Inonesense,C#canbeseenasbeingthesamethingtoprogramminglanguagesas.NETistotheWindowsenvironment.JustasMicrosofthasbeenaddingmoreandmorefeaturestoWindowsandtheWindowsAPIoverthepastdecade,VisualBasicandC++haveundergoneexpansion.AlthoughVisualBasicandC++haveendedupashugelypowerfullanguagesasaresultofthis,bothlanguagesalsosufferfromproblemsduetothelegaciesofhowtheyhaveevolved.

InthecaseofVisualBasic6andearlier,themainstrengthofthelanguagewasthefactthatitwassimpletounderstandanddidn’tmakemanyprogrammingtaskseasy,largelyhidingthedetailsoftheWindowsAPIandtheCOMcomponentinfrastructurefromthedeveloper.ThedownsidetothiswasthatVisualBasicwasnevertrulyobject-oriented,sothatlargeapplicationsquicklybecomedisorganizedandhardtomaintain.Aswellasthis,becauseVisualBasic’ssyntaxwasinheritedfromearlyversionsofBASIC(which,inturn,wasdesignedtobeintuitivelysimpleforbeginningprogrammerstounderstand,ratherthantowritelargecommercialapplications),itdidn’treallylenditselftowell-structuredorobject-orientedprograms.

C++,ontheotherhand,hasitsrootsintheANSIC++languagedefinition.Itisn’tcompletelyANSIcompliantforthesimplereasonthatMicrosoftfirstwroteitsC++compilerbeforetheANSIdefinitionhadbecomeofficial,butitcomesclose.Unfortunately,thishasledtotwoproblems.First,ANSIC++hasitsrootsinadecade-oldstateoftechnology,andthisshowsupinalackofsupportformodernconcepts(suchasUnicodestringsandgeneratingXMLdocumentation),andinsomearchaicsyntaxstructuresdesignedforthecompilersofyesteryear(suchastheseparationofdeclarationfromdefinitionofmemberfunctions).Second,MicrosofthasbeensimultaneouslytryingtoevolveC++intoalanguagethatisdesignedforhigh-performancetasksonWindows,andinordertoachievethatthey’vebeenforcedtoaddahugenumberofMicrosoft-specifickeywordsaswellasvariouslibrariestothelanguage.

TheresultisthatonWindows,thelanguagehasbecomeacompletemess.JustaskC++developershowmanydefinitionsforastringtheycanthinkof:

char*,LPTSTR,string,CString(MFCversion),CString(WTLversion),wchar_t*,OLECHAR*,andsoon.

Nowenter.NET—acompletelynewenvironmentthatisgoingtoinvolvenewextensionstobothlanguages.MicrosofthasgottenaroundthisbyaddingyetmoreMicrosoft-specifickeywordstoC++,andbycompletelyrevampingVisualBasicintoVisualBasic.NET,alanguagethatretainssomeofthebasicVBsyntaxbutthatissodifferentindesignthatwecanconsiderittobe,forallpracticalpurposes,anew

language.It’sinthiscontextthatMicrosofthasdecidedtogivedevelopersanalternative—alanguagedesignedspecificallyfor.NET,anddesignedwithacleanslate.VisualC#.NETistheresult.Officially,MicrosoftdescribesC#asa“simple,modern,object-oriented,andtype-safeprogramminglanguagederivedfrom

CandC++.〞Mostindependentobserverswouldprobablychangethatto“derivedfromC,C++,andJava.〞Suchdescriptionsaretechnicallyaccuratebutdolittletoconveythebeautyoreleganceofthelanguage.Syntactically,C#isverysimilartobothC++andJava,tosuchanextentthatmanykeywordsarethesame,andC#alsosharesthesameblockstructurewithbraces({})tomarkblocksofcode,andsemicolonstoseparatestatements.ThefirstimpressionofapieceofC#codeisthatitlooksquitelikeC++orJavacode.Behindthatinitialsimilarity,however,C#isaloteasiertolearnthanC++,andofcomparabledifficultytoJava.Itsdesignismoreintunewithmoderndevelopertoolsthanbothofthoseotherlanguages,andithasbeendesignedtogiveus,simultaneously,theeaseofuseofVisualBasic,andthehighperformance,low-levelmemoryaccessofC++ifrequired.SomeofthefeaturesofC#are:

❑Fullsupportforclassesandobject-orientedprogramming,includingbothinterfaceandimplementation

inheritance,virtualfunctions,andoperatoroverloading.

❑Aconsistentandwell-definedsetofbasictypes.

❑Built-insupportforautomaticgenerationofXMLdocumentation.

❑Automaticcleanupofdynamicallyallocatedmemory.

❑Thefacilitytomarkclassesormethodswithuser-definedattributes.Thiscanbeusefulfordocumentation

andcanhavesomeeffectsoncompilation(forexample,markingmethodstobe

compiledonlyindebugbuilds).

❑Fullaccesstothe.NETbaseclasslibrary,aswellaseasyaccesstotheWindowsAPI(ifyou

reallyneedit,whichwon’tbeallthatoften).

❑Pointersanddirectmemoryaccessareavailableifrequired,butthelanguagehasbeendesigned

insuchawaythatyoucanworkwithouttheminalmostallcases.

❑SupportforpropertiesandeventsinthestyleofVisualBasic.

❑Justbychangingthecompileroptions,youcancompileeit

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 农林牧渔 > 林学

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1