资源描述:
《[Programming.C#.5.0(Early.Release)].Ian.Griffiths.文字版》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、O’ReillyMedia,Inc.3/13/20121IntroducingC#TheC#programminglanguage(pronounced‘seesharp’)canbeusedformanykindsofapplications,includingwebsites,desktopapplications,games,phoneapps,andcommandlineutilities.C#hasbeencenterstageforWindowsdevelopersforaboutadecadenow,1sowhenMicrosoftannouncedthatWindow
2、s8wouldintroduceanewstyleofapplication,optimizedfortouch-basedinteractionontablets,itwasnosurprisethatC#wasoneofthefourlanguagestoofferfullsupportfromthestartfortheseMetrostyleapplications,asthey’recalled,(theothersbeingC++,JavaScript,andVisualBasic).AlthoughMicrosoftinventedC#,thelanguageandit
3、sruntimearedocumentedbythestandardsbodyECMA,enablinganyonetoimplementC#.Thisisnotmerelyhypothetical.TheopensourceMonoprojectathttp://www.mono-project.com/providestoolsforbuildingC#applicationsthatrunonLinux,iOSandAndroid.WhyC#?AlthoughtherearemanywaysyoucanuseC#,otherlanguagesarealwaysanoption.
4、WhymightyouchooseC#overthese?Itwilldependonwhatyouneedtodo,andwhatyoulikeanddislikeinaprogramminglanguage.Speakingformyself,IfindthatC#providesconsiderablepowerandflexibility,andworksatahighenoughlevelofabstractionthatIdon’texpendvastamountsofeffortonlittledetailsnotdirectlyrelatedtotheproblems
5、myprogramsaretryingtosolve.(I’mlookingatyou,C++.)MuchofC#’spowercomesfromtherangeofprogrammingtechniquesitsupports.Forexample,itoffersobject-orientedfeatures,generics,andfunctionalprogramming.Itsupportsbothdynamicandstatictyping.Itprovidespowerfullist-andset-orientedfeaturesthankstoLINQ.Themost
6、recentversionofthelanguageaddsintrinsicsupportforasynchronousprogramming.1NewtoWindows,atanyrate.1O’ReillyMedia,Inc.3/13/2012SomeofthemostimportantbenefitsofusingC#comefromitsruntime,whichprovidesservicessuchassecuritysandboxing,runtimetypechecking,exceptionhandling,threadmanagement,andperhapsi
7、tsmostimportantfeature,automatedmemorymanagement.Theruntimeprovidesagarbagecollectorthatfreesdevelopersfrommuchoftheworkassociatedwithrecoveringmemorythattheprogramisnolongerusing.Ofcourse,languagesdonotexistinavacuum—highqualityl