Chapter 2. Introducing C


Chapter 2. Introducing C#

C# [1] is probably the most important of all .NET languages. A large portion of BCL is written using C# itself. I have to stress that it is not the only viable language for writing .NET codes “ VB .NET has a large following too “ but it is obvious that C# does have a significant role to play in Microsoft's .NET plan.

[1] Strictly speaking, there is a difference between C# and Visual C#.NET. They are very much like how C++ and Visual C++ are related . C# is a language standardized by ECMA and which has originated from Microsoft as a language to write .NET code. Visual C#.NET refers to the whole development environment in VS .NET. This book does not try to differentiate between the two terms “ 'C#' and 'C#.NET' are used interchangeably.

Unlike Java, which is not a standardized language, [2] C# has been submitted to ECMA [3] by Intel, IBM, and Microsoft for standardization and future evolution.

[2] Java is currently self- regulated by the JCP initiated by Sun. JCP involves setting up expert groups from members of the industry to make recommendations and propose new specifications. Such specifications resemble real industrial standards, except for the fact that they are not maintained by a neutral international standards body. The Java Language Specification, J2EE and other Java-related specifications are 'specifications', not real 'standards'. Sun twice submitted Java to ECMA for standardization, but had “ on both occasions “ withdrawn the submission.

[3] ECMA (www.ecma.ch) is the standards body which regulates JavaScript too. The C# language specification is ECMA-334 (blue cover). You can download it freely in pdf/Postscript format at www.ecma.ch/ecma1/STAND/ecma-334.htm

The C# Language Specification stated the objectives and features of C#:

  • a simple, modern , general purpose , object-oriented programming language;

  • provides support for software engineering principles such as strong type checking, array bounds checking, detection of attempts to use uninitialized variables , and automatic garbage collection;

  • for use in developing software components suitable for deployment in distributed environments;

  • supports internationalization;

  • suitable for writing applications for both hosted and embedded systems, ranging from the very large that use sophisticated operating systems, down to the very small having dedicated functions.

Although primarily targeted at the .NET platform, C# can be adapted for many other purposes. It doesn't matter if you are writing a web application, a program that runs on your Windows desktop, or a minimalized version for use on a PDA “ C# is suitable for either.

VB .NET is very much more powerful than VB 6 after real OO features and support for multi-threading are (finally) added in. However, there are things which can be done in C# which cannot be done in VB .NET “ notably the writing of unsafe codes.

As mentioned in the previous chapter, C# has features that are not part of CLS. Such 'extended features' include operator overloading and unsigned types. It should be noted that although C# has been created to write code for the .NET runtime, the language itself can be quite independent of .NET. [4]

[4] Despite the apparent 'decoupling' between C# and .NET, my personal opinion is that in order for C# to succeed, it has to 'ride on' the widespread deployment of .NET. C# will never become popular if .NET does not.



From Java to C#. A Developers Guide
From Java to C#: A Developers Guide
ISBN: 0321136225
EAN: 2147483647
Year: 2003
Pages: 221
Authors: Heng Ngee Mok

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net