Introduction to C#

Goud.Kv
Posted by in C# category on for Beginner level | Points: 250 | Views : 4552 red flag
Rating: 5 out of 5  
 1 vote(s)

C# is an Object-oriented programming language. C# comes with simplicity, expressiveness and great performance to meet the programmer productivity.

Introduction

C# is an Object-oriented programming language. C# comes with simplicity, expressiveness and great performance to meet the programmer productivity.
It is platform-neutral and written to work effectively with Microsoft .NET Framework.

Overview

Object Orientation:
  • C# includes Encapsulation, Inheritance and Polymorphism with rich implementation of Object-Orientation.
  • Encapsulation is nothing but creating a boundary around the Object which separates its External behaviour(public) from its Internal implementation(private).
  • Features of C# based on Object-Oriented vision are,
    1. Unified Type System
    2. Classes
    3. Interfaces
    4. Properties
    5. Events
    6. Methods
Type Safety:
  • C# is a type-safe language as it supports Static Typing which means it enforces the type-safety at compile time.
  • 'Static Typing' eliminates large class of errors before running the program by shifting the burden away from runtime to  verify that all types are fitted correctly in the program or not.
  • 'Static Typing' makes the Bigger programs very easier to manage, predict and robust.
  • C# also allows Dynamical typing which is introduced in version 4.
  • Because of very strict typing rules, C# is also known as Strongly typed language.
Memory Management:
  • C# performs Memory Management automatically on the runtime.
  • Common Lanuage Runtime has a Garbage Collector which also executes as a part of your program and reclaims the memory for objects that are no longer referenced.
  • It deallocates the memory for an Object which results in the elimination of incorrect pointers encountered in some  languages like C++.
  • Eliminating pointers in the sense, it just makes them unnecessary for most programming tasks.
  • In some cases of performance, pointers might be used but are permitted only in blocks that marked unsafe explicitly.
Supporting Platforms:
  • C# is most commonly used to write code in Windows Platforms.
  • There are very small amount of non-windows platforms that are supported by C#.
  • C# can also be used to write the cross-platform code in some cases like,
    1. It runs on the server side and fires the HTML on any platform. Ex: ASP.NET.
    2. It also runs on the Microsoft Silverlight's host for both Windows and Mac OS X.
Relashionship with CLR:
  • CLR means Common Language Runtime designed by Microsoft.
  • Design of C# is almost similar to the design of CLR.
  • C# mostly depends on runtime with features like Automatic Memory-Management and Exeption Handling.
  • Although C# is technically independent of CLR, CLR also provides the C#'s runtime features.
  • Type system is also very similar in both and almost same for predefined types.
CLR and .NET Framework:
  • .NET Framework comes with CLR as well as very large set of libraries which are core and applied.
  • Applied libraries are those which depends on the Core libraries.
  • C# is a managed language that get compiled into a managed code where as CLR is a runtime for executing a managed code.
  • When CLR loads, it converts the managed code(which is in Intermediate Language) into native code(Ex: x86) of the machine with JIT(Just in Time)Compiler of CLR.
C# and Windows Runtime:
  • Windows Runtime is a runtime environment with execution interface for accessing libraries in Object-Oriented and language-Neutral fashion.
  • C# 5.0 also interoperates with Windows Runtime libraries.

Basic Version History

New Features in Version 3.0:
The most important features that comes with this version are based on LINQ(Language Integrated Query). They are,
    • Local Variables
    • Anonymous Types
    • Object Initializers
    • Lambda Expressions
    • Query Expressions
    • Extension methods
    • Expression Trees

New Features in Version 4.0:
There are so many features added in this version of C#. They are,
    • Dynamic Binding
    • Optional Parameters
    • Named Arguments
    • Type variance with delegates and generic interfaces.
    • COM Interoperability improvements

New Features in Version 5.0:
  • C# 5.0 comes with an extraordinary feaure that it supports Asynchronous functions by using async and await keywords.
  • These functions enable the Asynchronous continuations which results in making C# very easy to write responsive and thread-safe client-rich applications.
  • Asynchronous functions also makes c# easy to write effictive and highly concurrent I/O bound applications.

Conclusion

In this article, we have understand the overview and features of C#. Hope you got it.

Thanks for reading.

Regards,
Krishna.


Recommendation
Read Getting Started with Programming in C# after this article.
Page copy protected against web site content infringement by Copyscape

About the Author

Goud.Kv
Full Name: Krishna Vamshi Goud
Member Level: Gold
Member Status: Member,MVP
Member Since: 2/12/2014 2:34:09 AM
Country: India
Thanks & Regards, Krishna


Login to vote for this post.

Comments or Responses

Posted by: Sheonarayan on: 7/9/2014 | Points: 25
Very good start Vamsi.

Thanks and keep it up!

Login to post response

Comment using Facebook(Author doesn't get notification)