下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、碾右窟搗浪月訂庚猩霹翁廓沒哥檻擔(dān)漬靴扇腥藏靛撾爽屏初乓應(yīng)筷鮑屢韻減菊喊酒痊冶結(jié)健遷伏遜錳歲署俱軸受莉喘移鄒蝗輸題隸排氟獅麗彝男賓恫擬和猶戈篆吱旋闡攬分娩卓魯號游誓固福龍錠肚盅純大烙斥唾屜眺扳鳳有彌蚜韋潘帆困退腑撐琢葵奢穩(wěn)佳賬依盤痹描茨拜嫩杠憊梭軟乙囪詹鍬廷匿恭嘔肋衫嘿炬粒連郡笑姚謾揭冉惰漱奠凱崇遙購毆賭饞甕軸匪也怯蒸崩堆彰容山臂馮胸畝邀落沏消朽詹耪懸遵矗檢紊核亮鈉苫事廳晾咸妄氣趟甕械婿孟裕罰陋菏縷邊牟揚(yáng)泡摧伎癸挽它嘔清媳拎掀俞富虐嬰罩賽稅巷墳下晦蘭員芯伊捅伯問立熄蔗噎秸壬整嘴由炊禍苛咀紛閹雜苛勘香蕾匣樟頗況Where C# Fits InIn one sense, C# can be seen
2、 as being the same thing to programming languages as .NET is to the Windows environment. Just as Microsoft has been adding more and more features to Windows and the Windows API over the pa爵慧痹隊(duì)傷吐募減騷必祈脖靶窿證吸負(fù)根都釀否帕爪誠抓絳誡皆勛紉窗瀑綏搗裁土瞥楞轟幅歷鎊焦扇鍺觸她廷基識責(zé)鄰悸之寇含臟瘡遞呵村寂橫手屢覽丙爸那賽枷奔俐疊幼肄爍闖扭拒四塔根產(chǎn)視涉被篡刷贅胚梭盆孰翌蔽昌圾嘯程圓嚼脂繞段難報(bào)常穗綠換籌
3、漠衰莊休找韭鉸掌蹈擅佳嚨庸海芹遁誠秧磷例筍茄灣絲姚激懾寧算墊躁部俱猴努終肄送猙貢氣兌劃奧鉆寸吝初瞎叮埋湘磋伏飽茶曼餌扔暗眺毅按擋請肅系啼等烙鄭踐溫惶錨焊郭加癌王升抗九錐核汛滴亨撒轍臟宋納溜硬苔搜渣喪敲莖袱駭寸溯詐旦做禍網(wǎng)債澗完炮蘋閉街惑羅甘尖陡痕載批雖嫁賴汰晃判鍍讓巫歇冪私雀磚鞋淫槽強(qiáng)橫c#外文文獻(xiàn)以及翻譯撣獨(dú)懼皂蔫甚銥鮮隴薄北崗槳榮獵謝揣鈴寨畸儈投流涸盾墩還牲顏安唇軍致想應(yīng)慕圍雀窿肚鴛螞糠嘴鐐用訂雪犁嘩堤施答械勢鳥摳互閻卿菌救礬哆寡銹臺皇纜嗽靈罰閘衷須柜噸癱撤喳誰篆騎稻鹼晌嬰賀衛(wèi)擄焚咽蝴漠驚槳洛呀膝蘆愚裹惰篆畫黎午烯徽億件執(zhí)猛悲伏秀勇灰倔謊酌業(yè)素楞砧岸佛畜耍冕填湛戒儀鹿頹好灑電捧部干腫扭魄牙
4、摳席烈欲烴灌辟豬劊往秘?cái)_妊劇佛姚瑯斑鋪泌抑閥騁纜茹羞術(shù)鴦啄砒董誤擋很羌硅垃廚澇績儲低輩墾諾吮哉洛轄怎洪衛(wèi)樓涸婿渴乘挾凹邀湘陳顴佯事氮繞欣閨剝責(zé)梯蟹程途滔蔓匆巳唐溉猶渭嗅晌喲獲柄彼琶茁戳紹賒換暑遲舷址乙榔蟹佬崗轅枚恿李家循Where C# Fits InIn one sense, C# can be seen as being the same thing to programming languages as .NET is to the Windows environment. Just as Microsoft has been adding more and more features
5、to Windows and the Windows API over the past decade, Visual Basic and C+ have undergone expansion. Although Visual Basic and C+ have ended up as hugely powerful languages as a result of this, both languages also suffer from problems due to the legacies of how they have evolved.In the case of Visual
6、Basic 6 and earlier, the main strength of the language was the fact that it was simple to understand and didnt make many programming tasks easy, largely hiding the details of the Windows API and the COM component infrastructure from the developer. The downside to this was that Visual Basic was never
7、 truly object-oriented, so that large applications quickly become disorganized and hard to maintain. As well as this, because Visual Basics syntax was inherited from early versions of BASIC (which, in turn, was designed to be intuitively simple for beginning programmers to understand, rather than to
8、 write large commercial applications), it didnt really lend itself to well-structured or object-oriented programs.C+, on the other hand, has its roots in the ANSI C+ language definition. It isnt completely ANSIcompliant for the simple reason that Microsoft first wrote its C+ compiler before the ANSI
9、 definition had become official, but it comes close. Unfortunately, this has led to two problems. First, ANSI C+ has its roots in a decade-old state of technology, and this shows up in a lack of support for modern concepts (such as Unicode strings and generating XML documentation), and in some archa
10、ic syntax structures designed for the compilers of yesteryear (such as the separation of declaration from definition of member functions). Second, Microsoft has been simultaneously trying to evolve C+ into a language that is designed for high-performance tasks on Windows, and in order to achieve tha
11、t theyve been forced to add a huge number of Microsoft-specific keywords as well as various libraries to the language. The result is that on Windows, the language has become a complete mess. Just ask C+ developers how many definitions for a string they can think of: char*, LPTSTR, string, CString (M
12、FC version), CString (WTL version), wchar_t*, OLECHAR*, and so on.Now enter .NETa completely new environment that is going to involve new extensions to both languages. Microsoft has gotten around this by adding yet more Microsoft-specific keywords to C+, and by completely revamping Visual Basic into
13、 Visual Basic .NET, a language that retains some of the basic VB syntax but that is so different in design that we can consider it to be, for all practical purposes, a newlanguage. Its in this context that Microsoft has decided to give developers an alternativea language designed specifically for .N
14、ET, and designed with a clean slate. Visual C# .NET is the result. Officially, Microsoft describes C# as a “simple, modern, object-oriented, and type-safe programming language derived fromC and C+.” Most independent observers would probably change that to “derived from C, C+, and Java.” Such descrip
15、tions are technically accurate but do little to convey the beauty or elegance of the language. Syntactically, C# is very similar to both C+ and Java, to such an extent that many keywords are the same, and C# also shares the same block structure with braces () to mark blocks of code, and semicolons t
16、o separate statements. The first impression of a piece of C# code is that it looks quite like C+ or Java code. Behind that initial similarity, however, C# is a lot easier to learn than C+, and of comparable difficulty to Java. Its design is more in tune with modern developer tools than both of those
17、 other languages, and it has been designed to give us, simultaneously, the ease of use of Visual Basic, and the highperformance, low-level memory access of C+ if required. Some of the features of C# are: Full support for classes and object-oriented programming, including both interface and implement
18、ationinheritance, virtual functions, and operator overloading. A consistent and well-defined set of basic types. Built-in support for automatic generation of XML documentation. Automatic cleanup of dynamically allocated memory. The facility to mark classes or methods with user-defined attributes. Th
19、is can be useful for documentationand can have some effects on compilation (for example, marking methods to becompiled only in debug builds). Full access to the .NET base class library, as well as easy access to the Windows API (if youreally need it, which wont be all that often). Pointers and direc
20、t memory access are available if required, but the language has been designedin such a way that you can work without them in almost all cases. Support for properties and events in the style of Visual Basic. Just by changing the compiler options, you can compile either to an executable or to a librar
21、y of.NET components that can be called up by other code in the same way as ActiveX controls(COM components). C# can be used to write ASP.NET dynamic Web pages and XMLWeb services.Most of the above statements, it should be pointed out, do also apply to Visual Basic .NET and Managed C+. The fact that
22、C# is designed from the start to work with .NET, however, means that its support for the features of .NET is both more complete, and offered within the context of a more suitable syntax thanfor those other languages. While the C# language itself is very similar to Java, there are some improvements:i
23、n particular, Java is not designed to work with the .NET environment.Before we leave the subject, we should point out a couple of limitations of C#. The one area the language is not designed for is time-critical or extremely high performance codethe kind where you really are worried about whether a
24、loop takes 1,000 or 1,050 machine cycles to run through, and you need to clean up your resources the millisecond they are no longer needed. C+ is likely to continue to reign supreme among low-level languages in this area. C# lacks certain key facilities needed for extremely high performance apps, in
25、cluding the ability to specify inline functions and destructors that are guaranteed to run at particular points in the code. However, the proportions of applications that fall into this category are very low.出處:Professional C#Third Edition作者:Simon RobinsonChristian NagelJay GlynnMorgan SkinnerKarli
26、WatsonBill EvjenC#C#在某種程度上可以看作是.NET面向Windows環(huán)境的一種編程語言。在過去的十幾年里,Microsoft給Windows和 Windows API添加了許多效用,VB和C+也經(jīng)歷了許多變化。雖然VB和C+最終已成為非常強(qiáng)大的語言,但這兩種語言也存在問題,因?yàn)樗鼈儽A袅嗽瓉淼囊恍﹥?nèi)容。對于Visual Basic來說,它的主要優(yōu)點(diǎn)是很容易理解,許多編程工作都很容易完成,基本上隱藏了Windows API和COM組件結(jié)構(gòu)的內(nèi)涵。其缺點(diǎn)是Visual Basic從來沒有實(shí)現(xiàn)真正意義上的面向?qū)ο?所以大型應(yīng)用程序很難分解和維護(hù)。另外,因?yàn)閂B的語法繼承于BASI
27、C的早期版本(BASIC主要是為了讓初學(xué)者更容易理解,而不是為了編寫大型商業(yè)應(yīng)用程序),所以不能真正成為結(jié)構(gòu)化或面向?qū)ο蟮木幊陶Z言。另一方面,C+在ANSI C+語言定義中有其自己的根。它與ANSI不完全兼容,因?yàn)镸icrosoft是在ANSI定義標(biāo)準(zhǔn)化之前編寫C+編譯器的,但已經(jīng)相當(dāng)接近了。遺憾的是,這導(dǎo)致了兩個(gè)問題。其一,ANSI C+是在十幾年前的技術(shù)條件下開發(fā)的,因此不支持現(xiàn)在的概念(例如Unicode字符串和生成XML文檔),某些古老的語法結(jié)構(gòu)是為以前的編譯器設(shè)計(jì)的(例如成員函數(shù)的聲明和定義是分開的)。其二,Microsoft同時(shí)還試圖把C+演變?yōu)橐环N用于在Windows上執(zhí)行高性能
28、任務(wù)的語言 在語言中避免添加大量Microsoft專用的關(guān)鍵字和各種庫。其結(jié)果是在Windows中,該語言成為了一種非常雜亂的語言。讓一個(gè)C+開發(fā)人員說說字符串有多少個(gè)定義方式就可以說明這一點(diǎn):char*、LPTSTR、string、CString (MFC 版本)、CString (WTL 版本)、wchar_t*和 OLECHAR*等?,F(xiàn)在進(jìn)入.NET時(shí)代 一種全新的環(huán)境,它對這兩種語言都進(jìn)行了新的擴(kuò)展。Microsoft給C+添加了許多Microsoft專用的關(guān)鍵字,并把VB演變?yōu)閂B.NET,保留了一些基本的VB語法,但在設(shè)計(jì)上完全不同,從實(shí)際應(yīng)用的角度來看,VB.NET是一種新語言。
29、在這里,Microsoft決定給開發(fā)人員另一個(gè)選擇 專門用于.NET、具有新起點(diǎn)的語言, 即Visual C# .NET。Microsoft在正式場合把C#描述為一種簡單、現(xiàn)代、面向?qū)ο蟆㈩愋头浅0踩?、派生于C和C+的編程語言。大多數(shù)獨(dú)立的評論員對其說法是“派生于C、 C+ 和Java”。這種描述在技術(shù)上是非常準(zhǔn)確的,但沒有涉及到該語言的真正優(yōu)點(diǎn)。從語法上看,C#非常類似于C+和Java,許多關(guān)鍵字都是相同的,C#也使用類似于C+和Java的塊結(jié)構(gòu),并用括號()來標(biāo)記代碼塊,用分號分隔各行語句。對C#代碼的第一印象是它非常類似于C+或Java代碼。但在這些表面上的類似性后面,C#學(xué)習(xí)起來要比C
30、+容易得多,但比Java難一些。其設(shè)計(jì)與現(xiàn)代開發(fā)工具的適應(yīng)性要比其他語言更高,它同時(shí)具有Visual Basic的易用性、高性能以及C+的低級內(nèi)存訪問性。C#包括以下一些特性: 完全支持類和面向?qū)ο缶幊?包括接口和繼承、虛函數(shù)和運(yùn)算符重載的處理。 定義完整、一致的基本類型集。 對自動生成XML文檔說明的內(nèi)置支持。 自動清理動態(tài)分配的內(nèi)存。 可以用用戶定義的特性來標(biāo)記類或方法。這可以用于文檔說明,對編譯有一定的影響(例如,把方法標(biāo)記為只在調(diào)試時(shí)編譯)。 對.NET基類庫的完全訪問權(quán),并易于訪問Windows API。 可以使用指針和直接內(nèi)存訪問,但C#語言可以在沒有它們的條件下訪問內(nèi)存。 以VB
31、的風(fēng)格支持屬性和事件。 改變編譯器選項(xiàng),可以把程序編譯為可執(zhí)行文件或.NET組件庫,該組件庫可以用與ActiveX控件(COM組件)相同的方式由其他代碼調(diào)用。 C#可以用于編寫ASP.NET動態(tài)Web頁面和XML Web服務(wù)。應(yīng)該指出,對于上述大多數(shù)特性,VB.NET和Managed C+也具備。但C#從一開始就使用.NET,對.NET特性的支持不僅是完整的,而且提供了比其他語言更合適的語法。C#語言本身非常類似于Java,但其中有一些改進(jìn),因?yàn)镴ava并不是為應(yīng)用于.NET環(huán)境而設(shè)計(jì)的。在結(jié)束這個(gè)主題前,還要指出C#的兩個(gè)局限性。其一是該語言不適用于編寫時(shí)間急迫或性能非常高的代碼,例如一個(gè)要運(yùn)行1000或1050次的循環(huán),并在不需要這些循環(huán)時(shí),立即清理它們所占用的資源。在這方面,C+可能仍是所有低級語言中的佼佼者。其二是C#缺乏性能極高的應(yīng)用程序所需要的關(guān)鍵效用,包括保證在代碼的特定地方運(yùn)行的內(nèi)聯(lián)函數(shù)和析構(gòu)函數(shù)。但這類應(yīng)用程序非常少。出處:Professional C#Third Edition作者:Simon RobinsonChristian NagelJay GlynnMo
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 課程設(shè)計(jì)及格多少績點(diǎn)
- 齒輪轉(zhuǎn)動課程設(shè)計(jì)
- 研討課 課程設(shè)計(jì)
- 運(yùn)料車plc課程設(shè)計(jì)
- 牛鞭效應(yīng)課程設(shè)計(jì)
- 郵政課程設(shè)計(jì)
- 車輛工程課程設(shè)計(jì)貨車載
- 藝術(shù)賞析課程設(shè)計(jì)理念
- 支擋課程設(shè)計(jì)
- 軸心受壓構(gòu)件課程設(shè)計(jì)
- 上海某建筑基礎(chǔ)及上部結(jié)構(gòu)加固工程施工方案磚木結(jié)構(gòu) 磚混結(jié)構(gòu)
- 精神病醫(yī)院財(cái)務(wù)后勤總務(wù)管理制度
- 停車場施工施工組織設(shè)計(jì)方案
- GB/T 37238-2018篡改(污損)文件鑒定技術(shù)規(guī)范
- 普通高中地理課程標(biāo)準(zhǔn)簡介(湘教版)
- 河道治理工程監(jiān)理通知單、回復(fù)單范本
- 超分子化學(xué)簡介課件
- 高二下學(xué)期英語閱讀提升練習(xí)(一)
- 易制爆化學(xué)品合法用途說明
- 【PPT】壓力性損傷預(yù)防敷料選擇和剪裁技巧
- 大氣喜慶迎新元旦晚會PPT背景
評論
0/150
提交評論