C# (pronounced “C-sharp”) is an object-oriented programming language from Microsoft that aims to combine the computing power of C++ with the programming ease of Visual Basic. C# is based on C++ and contains features similar to those of Java.
Features of C#
GET INSTANT HELP FROM EXPERTS!
- Looking for any kind of help on your academic work (essay, assignment, project)?
- Want us to review, proofread or tidy up your work?
- Want a helping hand so that you can focus on the more important tasks?
Hire us as project guide/assistant. Contact us for more information
C# is a modern, general-purpose, object-oriented programming language .
It was developed by Microsoft.
C# was developed by Anders Hejlsberg.
It is component oriented.
It is easy to learn.
It is a structured language.
It produces efficient programs.
It can be compiled on a variety of computer platforms.
It is a part of .Net Framework.
MAIN FEATURES OF C#
1. SIMPLE
Pointers are missing in C#.
Unsafe operations such as direct memory manipulation are not allowed.
In C# there is no usage of “::” or “->” operators.
Since it’s on .NET, it inherits the features of automatic memory management and garbage collection.
Varying ranges of the primitive types like Integer, Floats etc.
Integer values of 0 and 1 are no longer accepted as boolean values.Boolean values are pure true or false values in C# so no more errors of “=”operator and “==”operator.
“==” is used for comparison operation and “=” is used for assignment operation.
2. MODERN
C# has been based according to the current trend and is very powerful and simple for building interoperable, scable, robust applications. C# includes built in support to turn any component into a web service that can be invoked over the internet from any application running on any platform.
3. OBJECT ORIENTED
C# supports Data Encapsulation, inheritance, polymorphism, interfaces.
(int,float, double) are not objects in java but C# has introduces structures(structs) which enable the primitive types to become objects.int i=1;string a=i Tostring(); //conversion (or) Boxing
The Common Language Infrastructure supports a two-step compilation process
C# compiler: Translation of C# source to CIL
Produces .dll and .exe files
Just in time compilation: Translation of CIL to machine code
Execution
With interleaved Just in Time compilation
On Mono: Explicit activation of the interpreter
On Window: Transparent activation of the interpreter
4. TYPE SAFE
In C# we cannot perform unsafe casts like convert double to a boolean.Value types (priitive types) are initialized to zeros and reference types (objects and classes) are initialized to null by the compiler automatically.arrays are zero base indexed and are bound checked.Overflow of types can be checked.
5. INTEROPERABILITY
C# includes native support for the COM and windows based applications.
Allowing restriced use of native pointers.
Users no longer have to explicitly implement the unknown and other COM interfacers, those features are built in.
C# allows the users to use pointers as unsafe code blocks to manipulate your old code.
Components from VB NET and other managed code languages and directlyt be used in C#.
6. SCALABLE AND UPDATEABLE
.NET has introduced assemblies which are self describing by means of their manifest. manifest establishes the assembly identity, version, culture and digital signature etc. Assemblies need not to be register anywhere.To scale our application we delete the old files and updating them with new ones. No registering of dynamic linking library.Updating software components is an error prone task. Revisions made to the code. can effect the existing program C# support versioning in the language. Native support for interfaces and method overriding enable complex frame works to be developed and evolved over time.
Compiler time process
The .Net framework has one or more language compliers, such as Visual Basic, C#, Visual C++, JScript, or one of many third-party compilers such as an Eiffel, Perl, or COBOL compiler.
Any one of the compilers translate your source code into Microsoft Intermediate Language (MSIL) code.
For example, if you are using the C# programming language to develop an application, when you compile the application, the C# language compiler will convert your source code into Microsoft Intermediate Language (MSIL) code.
In short, VB.NET, C# and other language compilers generate MSIL code. (In other words, compiling translates your source code into MSIL and generates the required metadata.)
Currently “Microsoft Intermediate Language” (MSIL) code is also known as “Intermediate Language” (IL) Codeor “Common Intermediate Language” (CIL) Code.
Runtime Process
The Common Language Runtime (CLR) includes a JIT compiler for converting MSIL to native code.
The JIT Compiler in CLR converts the MSIL code into native machine code that is then executed by the OS.
During the runtime of a program the “Just in Time” (JIT) compiler of the Common Language Runtime (CLR) uses the Metadata and converts Microsoft Intermediate Language (MSIL) into native code.BYTE CODE (MSIL + META DATA) —– Just-In-Time (JIT) compiler——> NATIVE CODE
StudyMumbai.com is an educational resource for students, parents, and teachers, with special focus on Mumbai. Our staff includes educators with several years of experience. Our mission is to simplify learning and to provide free education. Read more about us.
Leave a Reply
You must be logged in to post a comment.