Introduction to C# Programming

By   Posted at  7:40:00 AM  

Home  »  C#  »  Introduction to C# Programming

C# also called as C-Sharp is a new Programming language which is developed by Microsoft in 1995. C# language is also an pure object oriented programming language and it is made from c, c++ ,and java programming languages and this is purely web based language. C# is also known as component Oriented Language which uses in .NET framework Always Remember all the Major Code of .NET is written into C# language.
    In Early days there many programming languages were developed and they are used by developers according to their needs. Early Programming Languages have a business Environment and Scientific Environment So that there was no Programming Languages for all purpose. All Programming Languages have some Limitations those are as follows:-
1) They have high Complexity
2) They takes long cycle Time for Processing
3) They are not true object –oriented Languages
4) They have poor type-safety
5) They have a problem of versioning
6) They are not suitable with for working upon the web

As we know that visual basic is very powerful language which is used for developing graphical applications Visual Basic various tools which provide the ability to a user for creating a Reusable Code. But the main Problem of visual basic is that VB has not a purely OOP Language.
Java is purely OOP Language and this is very popular language on Web applications but java doesn't have some powerful features like operator overloading and it also have a problem of interacting with the another machines which have a different platforms and java is very difficult to learn and Execute.
So that Microsoft are comes with the new ideas those are based on web applications which integrates with Existing Systems which is known as c# language.


Evolution of C#

     We know that internet is growing day by day and demands of users are increased day by day. and internet also have some problems like we can open only a one site at a time and information which is Retrieved from the web is only Read-able and internet contains many information which doesn't co-operate with the platforms so that Microsoft Chairman Bill gates wanted to develop a Software Platform which will Remove the Limitations of internet and provides the ability to users to get information from anywhere and anytime. So that development work of .NET platform is being started in mid 90 and Microsoft Announced .NET in September 2000. C# is a descendent or made from c++ which is again made from C.

Features of C# Language

As We study Earlier that C# is made from the C and C++ Language so that there are So Many Features and The Syntax of C# are Similar to c and C++ so that a user doesn't have to face any difficulty for Writing the Code All the Syntax of C# are same as c and C++ and C# doesn't contains those things which are difficult for users to understand like pointers and -> pointer operator. And in operators C# provides a Same Meaning For = and == rather for Assigning or Checking a Value of Variable.

We know that in c and C++ have there is a Limit For Giving a Value or we can say that in C there is a Specific Range of Each and Every Data type and A user have to face the problem when he crosses the limit so that C# Remove this Problem . In this C# provides a Special data type which is called as object and this is used for storing any type of data either this may integer ,string or any float data and a user can increase a range easily in his program and C# Range of Variables are not Fixed but they Approximately extend up to 10 digits.

C# is also a Modern Language and it gives us an Error Message when we are using a Variable whose value is not initialized first and provides automatic values for variables those are also called as automatic garbage collection and also provides Exception handling Methods.

Object –Oriented
C# is made from c# and java so that C# is also am purely OOP Language means Every Program of C# is Written into the Classes with a Main Function Which Defines the Entry Point for Program Execution and it also Supports Encapsulation , polymorphism and Inheritance as a OOP Provides but C# also Doesn't Support Multiple inheritance but it Supports Operator Overloading.

C# Checks for the type Safety for all variables Means it gives values for variables if they are not Assigning values Like All Array and Static Elements are Assigned Zero when a user cant initialize values. This never allows a user to Casting a Variables Directly and this will protect the Loss of data after type Conversion and Type Casting and it also has a Checked Statement for checking the Overflow of Operations etc.

C # Supports two new Keywords which are new and override and With the help of these keywords any type of Version of Systems can use the Methods those are Made in C# Language They can Simple Override the Previous Declaration of Methods.

C# Supports Inter-Operability for Making Use of Methods of C# Language . Any Method of C-Sharp Can be Easily used by Any Language

Difference Between C# and C++

As We Know that C# Contains Many Features of C++ but there is Something Difference Between the c++ and C# those are as Follows:-
  1. After the Compilation of C# Program it Creates Executable File not an object File

  2. The First Character of Main is Always Capital instead of Smaller and this may int or void Return type.

  3. No Need For Header Files For Using a Function

  4. Un-Initialized Variables are doesn't take Garbage Value Rather Compiler will gives you an Error Message.

  5. Data types in C# are either value type of reference Types.

  6. C# Supports goto and Label Statements

  7. For Creating an Object we have to use new Keyword

  8. C# Provides a One more Loop Which is Known as ForEach

  9. In C# We can also Create a Switch on Strings

  10. For Overriding This is necessary For Methods . they might be declared as Override Keyword

  11. C# Doesn't Supports Default Arguments

  12. We can Pass Command Line Arguments

  13. For Checking overflow There are two Statements known as Checked and Unchecked

  14. C# Doesn't Support Multiple Inheritance

  15. C# Doesn't Provides any Defaults For Constructors

  16. For Abstract Methods they have no Implementation.

Difference between C# and Java

  1. C# has more built in data types.

  2. C# Provides Structure but java doesn't

  3. C# Provides Operator Overloading but C# Supports

  4. Code of Java is Converted into the Bytes Code But After the Compilation of C# Code is Directly Converted into the Executable or. Exe File is created.

  5. Java uses a Static Final For Making a Variable as Final but C# uses Const Keyword For Making a Variable as a Constant

  6. Array Declaration is Different from Java

  7. Java Provides Only vale Type Function calling because java doesn't Provides Pointers but in C# we can Pass a Argument as a Reference by using a Reference Keyword

  8. C# Provides another Loop Which is Called as For Each

  9. C# Supports For Passing Variable Number of Arguments Passes to a Function by using Params Keyword.

  10. In Java Member Functions are By Default Virtual Means They can be Override by derived Class but in C# For Overriding a Function Super Class must Contains Declaration For that Member Function as Virtual they derived Class can Override that Function

  11. C# Uses is Operator instead of InstanceOf of Checking whether a Variable is an Object of Class.

About the Author

Nulla sagittis convallis arcu. Sed sed nunc. Curabitur consequat. Quisque metus enim, venenatis fermentum, mollis in, porta et, nibh. Duis vulputate elit in elit. Mauris dictum libero id justo.
View all posts by: BT9

Back to top ↑
Connect with Me