Introduction to C# Programming Language


C# pronounced as c-sharp, is an objected-oriented programming language provided by Microsoft that runs on .NET Framework. Anders Hejlsberg is known as the founder of C# language. 


C# was created at Microsoft late in the 1990s and was part of Microsoft’s overall .NET strategy. It was first released in its alpha version in the middle of 2000, and in 2002 C# 1.0 is released. C# 2.0, released in 2005 was a watershed event in the lifecycle of C# because it added many new features. Current version of C# is C# 7.3 released in May 2018.

Feature of C#

·         Simple: C# is a simple language in the sense that it provides structured approach (to break the problem into parts), rich set of library functions, data types etc. 

·         Modern Programming Language: C# programming is based upon the current trend and it is very powerful and simple for building scalable, interoperable and robust applications.

·         Object Oriented: C# is object oriented programming language. OOPs makes development and maintenance easier where as in Procedure-oriented programming language it is not easy to manage if code grows as project size grow.  

·         Type Safe: C# type safe code can only access the memory location that it has permission to execute. Therefore, it improves a security of the program.

·         Interoperability:  Interoperability process enables the C# programs to do almost anything that a native C++ application can do. 

·         Scalable and Updateable: C# is automatic scalable and updateable programming language. For updating our application, we delete the old files and update them with new ones. 

·         Component Oriented: C# is component oriented programming language. It is the predominant software development methodology used to develop more robust and highly scalable applications. 

·         Structured Programing Language: C# is a structured programming language in the sense that we can break the program into parts using functions. So, it is easy to understand and modify.

·         Rich Library: C# provides a lot of inbuilt functions that makes the development fast.

·         Fast Speed: The compilation and execution time of C# language is fast. 

·         Cross-language Interoperability: This feature also known as mixed-language programming. This is an ability for code produce by one language to work easily with the code produce by another language.

Object Oriented Programming

OOP (Object Oriented Programming) is a programming methodology that helps organize complex programs through the use of inheritance, encapsulation, and polymorphism.  The core of the pure object-oriented programming is to create an object, in code, that has certain properties and methods. For example, a car is an object which has certain properties such as color, number of doors, and the like. It also has certain methods such as accelerate, brake, and so on. There are following basic principle of OOP (Object Oriented Programming) in C# programming:  



·         Object: This is the basic unit of object oriented programming. That is both data and function that operate on data are bundled as a unit called as object. 

·         Class: This define the blueprint of an object. This doesn't actually define any data, but it does define what the class name means, that is, what an object of the class will consist of and what operations can be performed.

·         Abstraction: Data abstraction refers to, providing only essential information to the outside world and hiding their background details.

·         Encapsulation: It is the mechanism that binds together code and the data it manipulates, and keeps both safe from outside interference and misuse.

·         Inheritance: It is the process by which one object acquires the properties of another object. This is important because it supports the concept of hierarchical classification. It makes code reusability possible in C#.

·         Polymorphism: Polymorphism (Greek meaning “many forms”) is a feature that allows one interface to be used for a general class of actions. The specific action is determined by the exact nature of the situation.


.NET Technology

·          .NET
C# was initially developed by Microsoft to create code for .NET Framework. .NET defines the environment that supports the development and execution of highly distributed, component-based application. It enables differing computer language to work together. .NET was original developed only for supporting Windows.
As it relates to C#, the .NET framework defines two very important entities. The first is the Common Language Runtime (CLR). This is the system that manages the execution of your program. The second entity is the .NET class library. This library gives your program access to the runtime environment, such as displaying something on the screen.

·     CLR
The Common Language Runtime (CLR) manages the execution of .NET code. When a C# program compile, the output of the compiler is not executable code. Instead, it is a file that contains a special type of pseudocode called Microsoft Intermediate Language (MSIL). MSIL defines a set of portable instructions that are independent of any specific CPU.  It is the job of the CLR to translate the intermediate code into executable code when a program is run. Microsoft Intermediate Language is turned into executable code using a JIT (just In Time) compiler.

The Container of MSIL is called assembly or portable executable. An assembly can be executable file (.exe) or a library (.dll) and contains IL (Intermediate Language) and type information (metadata).

The process works like this: When a .NET program is executed, the CLR activates the JIT compiler. The JIT compiler converts MSIL into native code on demand as each part of your program is needed. 

·        Other Platforms
Beside the .NET Framework, There are three others major Frameworks available:

·        Universal Windows Platform (UWP) 
For writing Windows 10 Store Apps and for targeting Windows 10 devices (mobile, Xbox, Surface Hub, HoloLens). 

·        .NET Core with ASP.NET Core 
An open source framework (originally based on a cut-down version of the .NET Framework) for writing easily deployable  Internet apps and microservices that run on Windows, macOS, and Linux. 

·        Xamarin
For writing mobile apps that target iOS, Android, and Windows Mobile. 

All Frameworks differ in the platform they support, and the library they support. However, it’s fair to say that as of the release of .NET Core 2.0, they all expose a similar core framework (BCL). It is also possible to write the code that can be run on all Frameworks by using .NET Standard. .NET Standard is a library that implements by all Frameworks.


Comments

Post a comment