c#外文文献以及翻译,DOC
- 格式:doc
- 大小:30.50 KB
- 文档页数:6
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++编