.NET and C# introduction In order to understand the significance of .NET, it is useful to remind ourselves of the nature of many of the Windows technologies that have appeared in the past ten years or so. Although they may look quite different on the surface, all of the Windows operating systems from Windows 3.1 (introduced in 1992) through Windows Server 2003 have the same familiar Windows API at their core. As we’ve progressed through new versions of Windows, huge numbers of new functions have been added to the API, but this has been a process of evolving and extending the API rather than replacing it.

While backward compatibility has been a crucial feature of Windows technologies and one of the strengths of the Windows platform, it does have a big disadvantage. Every time some technology evolves and adds new features, it ends up a bit more complicated than it was before.49282

This fresh start is what C# and .NET are all about. Roughly speaking, .NET is a new framework—a new API—for programming on the Windows platform. Along with the .NET Framework, C# is a new lan- guage that has been designed from scratch to work with .NET, as well as to take advantage of all the progress in developer environments and in our understanding of object-oriented programming princi- ples that have taken place over the past 20 years.

It’s in this context that Microsoft has decided to give developers an alternative—a language designed specifically 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 from C and C++.” Most independent observers would probably change that to “derived from C, C++, and Java.” Such descriptions are technically accurate but do little to convey the beauty or elegance of the lan- guage. 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 semi- colons 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 both of those other lan- guages, and it has been designed to give us, simultaneously, 论文网the ease of use of Visual Basic, and the high- performance, low-level memory access of C++ if required. Some of the features of C# are:

(1)Full support for classes and object-oriented programming, including both interface and imple- mentation inheritance, virtual functions, and operator overloading.

(2)A consistent and well-defined set of basic types.

(3)Built-in support for automatic generation of XML documentation.

(4)Automatic cleanup of dynamically allocated memory.

(5)The facility to mark classes or methods with user-defined attributes. This can be useful for doc- umentation and can have some effects on compilation (for example, marking methods to be compiled only in debug builds).

(6)Full access to the .NET base class library, as well as easy access to the Windows API (if you really need it, which won’t be all that often).

(7)Pointers and direct memory access are available if required, but the language has been designed in such a way that you can work without them in almost all cases.

(8)Support for properties and events in the style of Visual Basic.

(9)Just by changing the compiler options, you can compile either to an executable or to a library of .NET components that can be called up by other code in the same way as ActiveX controls(COM components).

(10)C# can be used to write ASP.NET dynamic Web pages and XML Web services.

Most of the above statements, it should be pointed out, do also apply to Visual Basic .NET and Managed C++. The 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 than for those other languages. While the C# language itself is very similar to Java, there are some improve- ments: in particular, Java is not designed to work with the .NET environment.

上一篇:高校计算机辅助教学英文文献和中文翻译
下一篇:华为网络产品英文文献和中文翻译

AngularJS技术介绍英文文献和中文翻译

开关电源水冷却系统英文文献和中文翻译

减数分裂和基因重组英文文献和中文翻译

太阳能最大功率点追踪和...

移动码头的泊位分配问题英文文献和中文翻译

虚拟船舶装配集成建模方...

中学生科学探究中对等论...

压疮高危人群的标准化中...

酵母菌发酵生产天然香料...

提高教育质量,构建大學生...

基于Joomla平台的计算机学院网站设计与开发

从政策角度谈黑龙江對俄...

STC89C52单片机NRF24L01的无线病房呼叫系统设计

AES算法GPU协处理下分组加...

浅谈高校行政管理人员的...

浅论职工思想政治工作茬...

上海居民的社会参与研究