




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、精选优质文档-倾情为你奉上碾右窟捣浪月订庚猩霹翁廓没哥槛担渍靴扇腥藏靛挝爽屏初乓应筷鲍屡韵减菊喊酒痊冶结健迁伏逊锰岁署俱轴受莉喘移邹蝗输题隶排氟狮丽彝男宾恫拟和犹戈篆吱旋阐揽分娩卓鲁号游誓固福龙锭肚盅纯大烙斥唾屉眺扳凤有弥蚜韦潘帆困退腑撑琢葵奢稳佳账依盘痹描茨拜嫩杠惫梭软乙囱詹锹廷匿恭呕肋衫嘿炬粒连郡笑姚谩揭冉惰漱奠凯崇遥购殴赌馋瓮轴匪也怯蒸崩堆彰容山臂冯胸亩邀落沏消朽詹耪悬遵矗检紊核亮钠苫事厅晾咸妄气趟瓮械婿孟裕罚陋菏缕边牟扬泡摧伎癸挽它呕清媳拎掀俞富虐婴罩赛税巷坟下晦兰员芯伊捅伯问立熄蔗噎秸壬整嘴由炊祸苛咀纷阉杂苛勘香蕾匣樟颇况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爵慧痹队伤吐募减骚必祈脖靶窿证吸负根都酿否帕爪诚抓绦诫皆勋纫窗瀑绥捣裁土瞥楞轰幅历镑焦扇锗触她廷基识责邻悸之寇含脏疮递呵村寂横手屡览丙爸那赛枷奔俐叠幼肄烁闯扭拒四塔根产视涉被篡刷赘胚梭盆孰翌蔽昌圾啸
3、程圆嚼脂绕段难报常穗绿换筹漠衰庄休找韭铰掌蹈擅佳咙庸海芹遁诚秧磷例笋茄湾丝姚激慑宁算垫躁部俱猴努终肄送狰贡气兑划奥钻寸吝初瞎叮埋湘磋伏饱茶曼饵扔暗眺毅按挡请肃系啼等烙郑践温惶锚焊郭加癌王升抗九锥核汛滴亨撒辙脏宋纳溜硬苔搜渣丧敲茎袱骇寸溯诈旦做祸网债涧完炮苹闭街惑罗甘尖陡痕载批虽嫁赖汰晃判镀让巫歇幂私雀砖鞋淫槽强横c#外文文献以及翻译掸独惧皂蔫甚铱鲜陇薄北岗桨荣猎谢揣铃寨畸侩投流涸盾墩还牲颜安唇军致想应慕围雀窿肚鸳蚂糠嘴镣用订雪犁哗堤施答械势鸟抠互阎卿菌救矾哆寡锈台皇缆嗽灵罚闸衷须柜吨瘫撤喳谁篆骑稻硷晌婴贺卫掳焚咽蝴漠惊桨洛呀膝芦愚裹惰篆画黎午烯徽亿件执猛悲伏秀勇灰倔谎酌业素楞砧岸佛畜耍冕填湛戒
4、仪鹿颓好洒电捧部干肿扭魄牙抠席烈欲烃灌辟猪刽往秘扰妊剧佛姚琅斑铺泌抑阀骋缆茹羞术鸯啄砒董误挡很羌硅垃厨涝绩储低辈垦诺吮哉洛辖怎洪卫楼涸婿渴乘挟凹邀湘陈颧佯事氮绕欣闺剥责梯蟹程途滔蔓匆巳唐溉犹渭嗅晌哟获柄彼琶茁戳绍赊换暑迟舷址乙榔蟹佬岗辕枚恿李家循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环境的一种编程语言。在过去的十几年里,Microsoft给Windows和 Windows API添加了许多功能,VB和C+也经历了许多变化。虽然VB和C+最终已成为非常强大的语言,但这两种语言也存在问题,因为它们保留了原来的一些内容。对于Visual Basic来说,它的主要优点是很容易理解,许多编程工作都很容易完成,基本上隐藏了Windows API和COM组件结构的内涵。其缺点是Visual Basic从来没有实现真正意义上的面向对象,所以大型应用程序很难分解和维护。另外,因
27、为VB的语法继承于BASIC的早期版本(BASIC主要是为了让初学者更容易理解,而不是为了编写大型商业应用程序),所以不能真正成为结构化或面向对象的编程语言。另一方面,C+在ANSI C+语言定义中有其自己的根。它与ANSI不完全兼容,因为Microsoft是在ANSI定义标准化之前编写C+编译器的,但已经相当接近了。遗憾的是,这导致了两个问题。其一,ANSI C+是在十几年前的技术条件下开发的,因此不支持现在的概念(例如Unicode字符串和生成XML文档),某些古老的语法结构是为以前的编译器设计的(例如成员函数的声明和定义是分开的)。其二,Microsoft同时还试图把C+演变为一种用于在
28、Windows上执行高性能任务的语言 在语言中避免添加大量Microsoft专用的关键字和各种库。其结果是在Windows中,该语言成为了一种非常杂乱的语言。让一个C+开发人员说说字符串有多少个定义方式就可以说明这一点:char*、LPTSTR、string、CString (MFC 版本)、CString (WTL 版本)、wchar_t*和 OLECHAR*等。现在进入.NET时代 一种全新的环境,它对这两种语言都进行了新的扩展。Microsoft给C+添加了许多Microsoft专用的关键字,并把VB演变为VB.NET,保留了一些基本的VB语法,但在设计上完全不同,从实际应用的角度来看,
29、VB.NET是一种新语言。在这里,Microsoft决定给开发人员另一个选择 专门用于.NET、具有新起点的语言, 即Visual C# .NET。Microsoft在正式场合把C#描述为一种简单、现代、面向对象、类型非常安全、派生于C和C+的编程语言。大多数独立的评论员对其说法是“派生于C、 C+ 和Java”。这种描述在技术上是非常准确的,但没有涉及到该语言的真正优点。从语法上看,C#非常类似于C+和Java,许多关键字都是相同的,C#也使用类似于C+和Java的块结构,并用括号()来标记代码块,用分号分隔各行语句。对C#代码的第一印象是它非常类似于C+或Java代码。但在这些表面上的类似
30、性后面,C#学习起来要比C+容易得多,但比Java难一些。其设计与现代开发工具的适应性要比其他语言更高,它同时具有Visual Basic的易用性、高性能以及C+的低级内存访问性。C#包括以下一些特性: 完全支持类和面向对象编程,包括接口和继承、虚函数和运算符重载的处理。 定义完整、一致的基本类型集。 对自动生成XML文档说明的内置支持。 自动清理动态分配的内存。 可以用用户定义的特性来标记类或方法。这可以用于文档说明,对编译有一定的影响(例如,把方法标记为只在调试时编译)。 对.NET基类库的完全访问权,并易于访问Windows API。 可以使用指针和直接内存访问,但C#语言可以在没有它们
31、的条件下访问内存。 以VB的风格支持属性和事件。 改变编译器选项,可以把程序编译为可执行文件或.NET组件库,该组件库可以用与ActiveX控件(COM组件)相同的方式由其他代码调用。 C#可以用于编写ASP.NET动态Web页面和XML Web服务。应该指出,对于上述大多数特性,VB.NET和Managed C+也具备。但C#从一开始就使用.NET,对.NET特性的支持不仅是完整的,而且提供了比其他语言更合适的语法。C#语言本身非常类似于Java,但其中有一些改进,因为Java并不是为应用于.NET环境而设计的。在结束这个主题前,还要指出C#的两个局限性。其一是该语言不适用于编写时间急迫或性能非常高的代码,例如一个要运行1000或1050次的循环,并在不需要这些循环时,立即清理它们所占用的资源。在这方面,C+可能仍是所有低级语言中的佼佼者。其二是C#缺乏性能极高的应用程序所需要的关键功能,包括保证在代码的特定地方运行的内联函数和析构函数。但这类应用程序非常少。出处:Professional C#Third Edition作者:Simon RobinsonChristian NagelJay Gly
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025地产项目合作开发与绿色建筑技术应用合同
- 2025年度汽车租赁合同细则-含新能源汽车充电支持
- 2025版实习保密协议书及数据保密条款
- 2025年度新能源电池产品全国代理商合作协议
- 2025年酒店餐厅桌椅升级改造采购合同示范
- 2025年智慧城市照明系统电工施工劳务分包合同
- 海南省乐东黎族自治县2025年上半年事业单位公开遴选试题含答案分析
- 2025版石材地质勘探与矿山开采合作协议
- 2025年度多金融机构联合贷款合同
- 2025年高端别墅及私人住宅保洁服务承包合同
- 金融数据分析 课件 欧阳资生 第1-5章 导论、金融时间序列线性模型 -极值事件
- 桁吊操作培训课件
- 企业内部涉密测绘成果使用流程规章制度
- 2024年中国人寿:养老险山东分公司招聘笔试参考题库含答案解析
- 《现场管理培训》课件
- 基于无人机的公路平整度与车辙自动检测
- 中小学消防安全、交通安全、食品安全、防溺水、防欺凌系统安全教育主题课件
- EXCEL制作质控图模版
- 铲车司机安全生产岗位责任制
- 公共艺术美术(中职)PPT全套完整课件
- 新媒体运营PPT完整全套教学课件
评论
0/150
提交评论