Introduction to C#
By : Adil Saeed Khan
This article will briefly describe about
the new Programming language C# ( C sharp ) launched by Microsoft.
We have seen C, BCPL, C++, and other programming languages but recently
Microsoft introduced a new language C# known as “C Sharp". This language is
compatible with Microsoft .Net frame work. C# includes most of features of C,
C++ and Java also.
Basically, this is object oriented programming language. Its syntax is similar
to C and C++. There is little difference in syntax between C# and C++. Like Main
have no return type, no semicolons after names of class, there are some strange
decisions regarding capitalization - such as the capitalization of Main. Other
than few differences syntax is same. This decision is reasonable, in light of
the fact that C syntax has been used with several other languages except Java.
Like Java, C# does not support multiple inheritance, but it do provides Java's
solution in form of interfaces. Interfaces implemented by a class specify
certain functions that the class is guaranteed to implement. Interfaces avoid
the dangers of multiple inheritance while maintaining the ability to let several
classes implement the same set of methods.
C# has got many powerful and helpful features like garbage collection. So, you
don’t need to include a destructor in each class unless class handles unmanaged
resources. If so, it's necessary to release control those resources from within
the class. Of course, C# also provides direct access to memory through C++ style
pointers, but these pointers are not garbage collected until specifically
released by the programmer
C#, as part of the .NET framework is compiled to Microsoft Intermediate Language
(MSIL). It is a language similar to Java's byte code. MSIL allows C# to be
platform independent and runs using just in time compiling. Therefore programs
running under .NET gain speed with repeated use. Furthermore, because the other
languages that make up the .NET platform including VB and Cobol compile to MSIL,
it is possible for classes to be inherited across languages. The MSIL, like byte
code, is what allows C# to be platform independent.
There is more potential for C#, if the .NET platform succeeds. C# is designed to
take advantage of the design of .NET and Microsoft has poured a great deal of
money into .NET. If you want to learn C# and you are C++ programmer then believe
you me you can learn it very easily. Of course, you can use C++ with .NET. You
should keep an eye on C# so that you can see how it can affect you.
By : Adil Saeed Khan
Url : www.adilsaeed.com
e-mail :
iam@adilsaeed.com
Phone : |+92-300-5283757|