c#外文文献以及翻译,DOC

  • 格式:doc
  • 大小:30.50 KB
  • 文档页数:6

下载文档原格式

  / 6
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

WhereC#FitsIn

Inonesense,C#istot heWindowsenvironment.JustasMicrosofthasbeenaddingmoreandmorefeaturestoWindo wsandtheWindowsAPIoverthepastdecade,VisualBasicandC++haveundergoneexpansio n.AlthoughVisualBasicandC++haveendedupashugelypowerfullanguagesasaresultofthi s,bothlanguagesalsosufferfromproblemsduetothelegaciesofhowtheyhaveevolved. InthecaseofVisualBasic6andearlier,themainstrengthofthelanguagewasthefactthatitw assimpletounderstandanddidn’tmakemanyprogram mingtaskseasy,largelyhidingthedeta ilsoftheWindowsAPIandtheCOMcomponentinfrastructurefromthedeveloper.Thedown

,anddesignedwithacleanslate.VisualC#.NETisther esult.Officially,MicrosoftdescribesC#asa“simple,modern,object-oriented,andtype-safe programminglanguagederivedfrom

CandC++.”Mostindependentobserverswouldprobablychangethatto“derivedfromC,C+ +,andJava.”Suchdescriptionsaretechnicallyaccuratebutdolittletoconveythebeautyorele ganceofthelanguage.Syntactically,C#isverysimilartobothC++andJava,tosuchanextentt hatmanykeywordsarethesame,andC#alsosharesthesameblockstructurewithbraces({})to markblocksofcode,andsemicolonstoseparatestatements.ThefirstimpressionofapieceofC #codeisthatitlooksquitelikeC++orJavacode.Behindthatinitialsimilarity,however,C#isal oteasiertolearnthanC++,andofcomparabledifficultytoJava.Itsdesignismoreintunewithm

oderndevelopertoolsthanbothofthoseotherlanguages,andithasbeendesignedtogiveus,si multaneously,theeaseofuseofVisualBasic,andthehighperformance,low-levelmemoryac cessofC++ifrequired.SomeofthefeaturesofC#are:

Fullsupportforclassesandobject-orientedprogramming,includingbothinterfaceandimple mentation

inheritance,virtualfunctions,andoperatoroverloading.

❑Aconsistentandwell-definedsetofbasictypes.

❑Built-insupportforautomaticgenerationofXMLdocumentation.

❑Automaticcleanupofdynamicallyallocatedmemory.

Beforeweleavethesubject,weshouldpointoutacoupleoflimitationsofC#.Theoneareathela nguageisnotdesignedforistime-criticalorextremelyhighperformancecode—thekindwhe reyoureallyareworriedaboutwhetheralooptakes1,000or1,050machinecyclestorunthroug h,andyouneedtocleanupyourresourcesthemillisecondtheyarenolongerneeded.C++islike lytocontinuetoreignsupremeamonglow-levellanguagesinthisarea.C#lackscertainkeyfac ilitiesneededforextremelyhighperformanceapps,includingtheabilitytospecifyinlinefunc tionsanddestructorsthatareguaranteedtorunatparticularpointsinthecode.However,thepro portionsofapplicationsthatfallintothiscategoryareverylow.

出处:ProfessionalC#ThirdEdition

作者:SimonRobinson

ChristianNagel

JayGlynn

MorganSkinner

KarliWatson

BASIC的早期版本(BASIC主要是为了让初学者更容易理解,而不是为了编写大型商业应用程序),所以不能真正成为结构化或面向对象的编程语言。

另一方面,C++在ANSIC++语言定义中有其自己的根。它与ANSI 不完全兼容,因为Microsoft是在ANSI定义标准化之前编写C++编