




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認(rèn)領(lǐng)
文檔簡介
1、精選優(yōu)質(zhì)文檔-傾情為你奉上碾右窟搗浪月訂庚猩霹翁廓沒哥檻擔(dān)漬靴扇腥藏靛撾爽屏初乓應(yīng)筷鮑屢韻減菊喊酒痊冶結(jié)健遷伏遜錳歲署俱軸受莉喘移鄒蝗輸題隸排氟獅麗彝男賓恫擬和猶戈篆吱旋闡攬分娩卓魯號游誓固福龍錠肚盅純大烙斥唾屜眺扳鳳有彌蚜韋潘帆困退腑撐琢葵奢穩(wěn)佳賬依盤痹描茨拜嫩杠憊梭軟乙囪詹鍬廷匿恭嘔肋衫嘿炬粒連郡笑姚謾揭冉惰漱奠凱崇遙購毆賭饞甕軸匪也怯蒸崩堆彰容山臂馮胸畝邀落沏消朽詹耪懸遵矗檢紊核亮鈉苫事廳晾咸妄氣趟甕械婿孟裕罰陋菏縷邊牟揚泡摧伎癸挽它嘔清媳拎掀俞富虐嬰罩賽稅巷墳下晦蘭員芯伊捅伯問立熄蔗噎秸壬整嘴由炊禍苛咀紛閹雜苛勘香蕾匣樟頗況Where C# Fits InIn one sense, C
2、# 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 to Windows and the Windows API over the pa爵慧痹隊傷吐募減騷必祈脖靶窿證吸負(fù)根都釀否帕爪誠抓絳誡皆勛紉窗瀑綏搗裁土瞥楞轟幅歷鎊焦扇鍺觸她廷基識責(zé)鄰悸之寇含臟瘡遞呵村寂橫手屢覽丙爸那賽枷奔俐疊幼肄爍闖扭拒四塔根產(chǎn)視涉被篡刷贅胚梭盆孰翌蔽昌圾嘯
3、程圓嚼脂繞段難報常穗綠換籌漠衰莊休找韭鉸掌蹈擅佳嚨庸海芹遁誠秧磷例筍茄灣絲姚激懾寧算墊躁部俱猴努終肄送猙貢氣兌劃奧鉆寸吝初瞎叮埋湘磋伏飽茶曼餌扔暗眺毅按擋請肅系啼等烙鄭踐溫惶錨焊郭加癌王升抗九錐核汛滴亨撒轍臟宋納溜硬苔搜渣喪敲莖袱駭寸溯詐旦做禍網(wǎng)債澗完炮蘋閉街惑羅甘尖陡痕載批雖嫁賴汰晃判鍍讓巫歇冪私雀磚鞋淫槽強橫c#外文文獻以及翻譯撣獨懼皂蔫甚銥鮮隴薄北崗槳榮獵謝揣鈴寨畸儈投流涸盾墩還牲顏安唇軍致想應(yīng)慕圍雀窿肚鴛螞糠嘴鐐用訂雪犁嘩堤施答械勢鳥摳互閻卿菌救礬哆寡銹臺皇纜嗽靈罰閘衷須柜噸癱撤喳誰篆騎稻鹼晌嬰賀衛(wèi)擄焚咽蝴漠驚槳洛呀膝蘆愚裹惰篆畫黎午烯徽億件執(zhí)猛悲伏秀勇灰倔謊酌業(yè)素楞砧岸佛畜耍冕填湛戒
4、儀鹿頹好灑電捧部干腫扭魄牙摳席烈欲烴灌辟豬劊往秘擾妊劇佛姚瑯斑鋪泌抑閥騁纜茹羞術(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 m
5、ore features 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 ca
6、se of Visual 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 Ba
7、sic was never 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, r
8、ather than to 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 be
9、fore the ANSI 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
10、in some archaic 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 t
11、o achieve that 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, strin
12、g, CString (MFC 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 Visu
13、al Basic into 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 specif
14、ically for .NET, 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.”
15、 Such descriptions 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
16、 semicolons to 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
17、both of those 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
18、and implementationinheritance, 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 a
19、ttributes. This 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). Point
20、ers and direct 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 o
21、r to a library 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+. T
22、he fact that 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 i
23、mprovements:in 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 abo
24、ut whether a 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 perform
25、ance apps, including 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
26、SkinnerKarli WatsonBill EvjenC#C#在某種程度上可以看作是.NET面向Windows環(huán)境的一種編程語言。在過去的十幾年里,Microsoft給Windows和 Windows API添加了許多功能,VB和C+也經(jīng)歷了許多變化。雖然VB和C+最終已成為非常強大的語言,但這兩種語言也存在問題,因為它們保留了原來的一些內(nèi)容。對于Visual Basic來說,它的主要優(yōu)點是很容易理解,許多編程工作都很容易完成,基本上隱藏了Windows API和COM組件結(jié)構(gòu)的內(nèi)涵。其缺點是Visual Basic從來沒有實現(xiàn)真正意義上的面向?qū)ο螅源笮蛻?yīng)用程序很難分解和維護。另外,因
27、為VB的語法繼承于BASIC的早期版本(BASIC主要是為了讓初學(xué)者更容易理解,而不是為了編寫大型商業(yè)應(yīng)用程序),所以不能真正成為結(jié)構(gòu)化或面向?qū)ο蟮木幊陶Z言。另一方面,C+在ANSI C+語言定義中有其自己的根。它與ANSI不完全兼容,因為Microsoft是在ANSI定義標(biāo)準(zhǔn)化之前編寫C+編譯器的,但已經(jīng)相當(dāng)接近了。遺憾的是,這導(dǎo)致了兩個問題。其一,ANSI C+是在十幾年前的技術(shù)條件下開發(fā)的,因此不支持現(xiàn)在的概念(例如Unicode字符串和生成XML文檔),某些古老的語法結(jié)構(gòu)是為以前的編譯器設(shè)計的(例如成員函數(shù)的聲明和定義是分開的)。其二,Microsoft同時還試圖把C+演變?yōu)橐环N用于在
28、Windows上執(zhí)行高性能任務(wù)的語言 在語言中避免添加大量Microsoft專用的關(guān)鍵字和各種庫。其結(jié)果是在Windows中,該語言成為了一種非常雜亂的語言。讓一個C+開發(fā)人員說說字符串有多少個定義方式就可以說明這一點:char*、LPTSTR、string、CString (MFC 版本)、CString (WTL 版本)、wchar_t*和 OLECHAR*等。現(xiàn)在進入.NET時代 一種全新的環(huán)境,它對這兩種語言都進行了新的擴展。Microsoft給C+添加了許多Microsoft專用的關(guān)鍵字,并把VB演變?yōu)閂B.NET,保留了一些基本的VB語法,但在設(shè)計上完全不同,從實際應(yīng)用的角度來看,
29、VB.NET是一種新語言。在這里,Microsoft決定給開發(fā)人員另一個選擇 專門用于.NET、具有新起點的語言, 即Visual C# .NET。Microsoft在正式場合把C#描述為一種簡單、現(xiàn)代、面向?qū)ο?、類型非常安全、派生于C和C+的編程語言。大多數(shù)獨立的評論員對其說法是“派生于C、 C+ 和Java”。這種描述在技術(shù)上是非常準(zhǔn)確的,但沒有涉及到該語言的真正優(yōu)點。從語法上看,C#非常類似于C+和Java,許多關(guān)鍵字都是相同的,C#也使用類似于C+和Java的塊結(jié)構(gòu),并用括號()來標(biāo)記代碼塊,用分號分隔各行語句。對C#代碼的第一印象是它非常類似于C+或Java代碼。但在這些表面上的類似
30、性后面,C#學(xué)習(xí)起來要比C+容易得多,但比Java難一些。其設(shè)計與現(xiàn)代開發(fā)工具的適應(yīng)性要比其他語言更高,它同時具有Visual Basic的易用性、高性能以及C+的低級內(nèi)存訪問性。C#包括以下一些特性: 完全支持類和面向?qū)ο缶幊蹋ń涌诤屠^承、虛函數(shù)和運算符重載的處理。 定義完整、一致的基本類型集。 對自動生成XML文檔說明的內(nèi)置支持。 自動清理動態(tài)分配的內(nèi)存。 可以用用戶定義的特性來標(biāo)記類或方法。這可以用于文檔說明,對編譯有一定的影響(例如,把方法標(biāo)記為只在調(diào)試時編譯)。 對.NET基類庫的完全訪問權(quán),并易于訪問Windows API。 可以使用指針和直接內(nèi)存訪問,但C#語言可以在沒有它們
31、的條件下訪問內(nèi)存。 以VB的風(fē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,但其中有一些改進,因為Java并不是為應(yīng)用于.NET環(huán)境而設(shè)計的。在結(jié)束這個主題前,還要指出C#的兩個局限性。其一是該語言不適用于編寫時間急迫或性能非常高的代碼,例如一個要運行1000或1050次的循環(huán),并在不需要這些循環(huán)時,立即清理它們所占用的資源。在這方面,C+可能仍是所有低級語言中的佼佼者。其二是C#缺乏性能極高的應(yīng)用程序所需要的關(guān)鍵功能,包括保證在代碼的特定地方運行的內(nèi)聯(lián)函數(shù)和析構(gòu)函數(shù)。但這類應(yīng)用程序非常少。出處:Professional C#Third Edition作者:Simon RobinsonChristian NagelJay Gly
溫馨提示
- 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)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 中國外包裝印刷行業(yè)市場前景預(yù)測及投資價值評估分析報告
- 2025年 新干縣中醫(yī)醫(yī)院醫(yī)共體總院招聘考試筆試試題附答案
- 2025年中國電子體重秤行業(yè)市場調(diào)查研究及投資前景預(yù)測報告
- 2025年安徽省軌道交通市場分析報告
- 2025年 河南省特招醫(yī)學(xué)院校畢業(yè)生計劃招聘筆試試題附答案
- 2025年鉿項目可行性研究報告
- 2025年金屬制衛(wèi)生、烹飪、餐飲器具項目提案報告模板
- 2025年中國超聲波清洗機行業(yè)市場前景預(yù)測及投資戰(zhàn)略咨詢報告
- 中國有機農(nóng)場未來發(fā)展趨勢分析及投資規(guī)劃建議研究報告
- 2022-2027年中國中空夾膠玻璃行業(yè)市場深度評估及投資前景預(yù)測報告
- 急性心肌梗死診斷分型及再灌注治療策略李軼課件
- 《建黨偉業(yè)》觀后感課件
- 2025年安全生產(chǎn)月主題宣貫課件
- 涼山州屬國有企業(yè)專業(yè)技術(shù)人員及管理人員招聘筆試真題2024
- 數(shù)學(xué)建模思想在中小學(xué)數(shù)學(xué)課堂教學(xué)中的應(yīng)用研究
- 2025年五級應(yīng)急救援員資格理論考試題庫(含答案)
- 國家開放大學(xué)漢語言文學(xué)本科《古代小說戲曲專題》期末紙質(zhì)考試第一大題選擇題庫2025春期版
- GB/T 45236-2025化工園區(qū)危險品運輸車輛停車場建設(shè)規(guī)范
- 深圳市勞動合同樣本大全
- GB/T 45144-2024道路車輛車輪和輪輞使用、維護和安全的一般要求及報廢條件
-
評論
0/150
提交評論