Introduction to C# Programming Language

Introduction to C# Programming Language

In this article, I am going to give a brief Introduction to C# Programming Language. Please read our previous article where we discussed Algorithms, Pseudocode, Programs, and Flowcharts in detail. At the end of this article, you will understand mostly What is C#, Features of C#. What are the different types of applications developed using C#, C# version history, and what C# can do for us?

What is C#?

C# is pronounced as “C-Sharp”. It is an object-oriented programming language provided by Microsoft that runs on the .Net Framework. C# is a modern, general-purpose, object-oriented programming language developed by Microsoft and approved by European Computer Manufacturers Association (ECMA) and International Standards Organization (ISO).

C# was developed by Anders Hejlsberg and his team during the development of the .Net Framework. C# is designed for Common Language Infrastructure (CLI), which consists of the executable code and runtime environment that allows the use of various high-level languages on different computer platforms and architectures. The following reasons make C# a widely used professional language −

  1. It is a modern, general-purpose programming language
  2. It is object-oriented.
  3. It is component-oriented.
  4. It is easy to learn.
  5. It is a structured language.
  6. It produces efficient programs.
  7. It can be compiled on a variety of computer platforms.
  8. It is a part of the .Net Framework.
Features of C#

Although C# constructs closely follow traditional high-level languages, C and C++ and being an object-oriented programming languages. It has a strong resemblance with Java, it has numerous strong programming features that make it endearing to a number of programmers worldwide. Following is the list of a few important features of C# −

  1. Simple: C# is a simple language in the sense that it provides a structured approach (to break the problem into parts), a rich set of library functions, data types, etc.
  2. 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.
  3. Object-Oriented: C# is an object-oriented programming language. OOPs makes development and maintenance easier whereas in Procedure-oriented programming language it is not easy to manage if code grows as the project size grows.
  4. Type-Safe: C# type safe code can only access the memory location that it has permission to execute. Therefore, it improves the security of the program.
  5. Interoperability: The interoperability process enables the C# programs to do almost anything that a native C++ application can do.
  6. Scalable and Updateable: C# is an automatic scalable and updateable programming language. For updating our application, we delete the old files and update them with new ones.
  7. Component Oriented: C# is a component-oriented programming language. It is the predominant software development methodology used to develop more robust and highly scalable applications.
  8. Structured Programming 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.
  9. Rich Library: C# provides a lot of inbuilt functions that make the development fast.
  10. Fast Speed: The compilation and execution time of the C# language is fast.
Types of Applications Developed using C#:

With the help of the C# programming language, we can develop different types of secured and robust applications:

  1. Window applications
  2. Web applications
  3. Distributed applications
  4. Web service applications
  5. Database applications etc.

C# is approved as a standard by ECMA and ISO. C# is designed for CLI (Common Language Infrastructure). CLI is a specification that describes executable code and runtime environment. The C# programming language is influenced by C++, Java, Eiffel, Modula-3, Pascal, etc. languages.

C# History

The history of the C# language is interesting to know. C# is pronounced as “C-Sharp”. It is an object-oriented programming language provided by Microsoft that runs on the .Net Framework. Anders Hejlsberg is known as the founder of the C# language.

Introduction to C# Programming Language

It is based on C++ and Java, but it has many additional extensions used to perform component-oriented programming approaches. C# has evolved much since its first release in the year 2002. It was introduced with .NET Framework 1.0 and the current version of C# is 5.0. Let’s see the important features introduced in each version of C# are given below.

C# Version History

C# was first introduced with .NET Framework 1.0 in the year 2002 and evolved much since then. The following table lists important features introduced in each version of C#:

C# 1.0:

.NET Framework: .NET Framework 1.0/1.1

Visual Studio: Visual Studio .NET 2002

Important Features:

  1. Basic features
C# 2.0

.NET Framework: NET Framework 2.0

Visual Studio: Visual Studio 2005

Important Features:

  1. Generics
  2. Partial types
  3. Anonymous methods
  4. Iterators
  5. Nullable types
  6. Private setters (properties)
  7. Method group conversions (delegates)
  8. Covariance and Contra-variance
  9. Static classes
C# 3.0

.NET Framework: .NET Framework 3.0\3.5

Visual Studio: Visual Studio 2008

Important Features:

  1. Implicitly typed local variables
  2. Object and collection initializers
  3. Auto-Implemented properties
  4. Anonymous types
  5. Extension methods
  6. Query expressions
  7. Lambda expressions
  8. Expression trees
  9. Partial Methods
C# 4.0

.NET Framework: .NET Framework 4.0

Visual Studio: Visual Studio 2010

Important Features:

  1. Dynamic binding (late binding)
  2. Named and optional arguments
  3. Generic co- and contravariance
  4. Embedded interop types
C# 5.0

.NET Framework: .NET Framework 4.5

Visual Studio: Visual Studio 2012/2013

Important Features:

  1. Async features
  2. Caller information
C# 6.0

.NET Framework: .NET Framework 4.6

Visual Studio: Visual Studio 2013/2015

Important Features:

  1. Expression Bodied Methods
  2. Auto-property initializer
  3. nameof Expression
  4. Primary constructor
  5. Await in the catch block
  6. Exception Filter
  7. String Interpolation
C# 7.0

.NET Framework: .NET Core 2.0

Visual Studio: Visual Studio 2017

Important Features:

  1. Out Variables in C#
  2. Pattern Matching in C#
  3. Digit Separators in C#
  4. Tuples in C#
  5. Splitting Tuples in C#
  6. Local Functions in C#
  7. Ref Returns and Ref Locals in C#
  8. Generalized Async Return Types in C#
  9. Expression Bodied Members in C#
  10. Thrown Expression in C#
  11. Async Main in C#
C# 8.0

.NET Framework: .NET Core 3.0

Visual Studio: Visual Studio 2019

Important Features:

  1. Default interface methods
  2. Nullable reference types
  3. Pattern matching enhancements
  4. Asynchronous streams / Asynchronous disposable
  5. Using declarations
  6. Enhancement of interpolated verbatim strings
  7. Null-coalescing assignment
  8. Static local functions
  9. Indices and ranges
  10. Unmanaged constructed types
  11. Readonly-Member
  12. Stackalloc in nested expressions
  13. Disposable ref structs
C# 9.0

.NET Framework: .NET 5.0

Visual Studio: Visual Studio 2019

Important Features:

  1. Top-level statements
  2. Record types
  3. Init-only setters
  4. Enhancements to pattern matching
  5. Natural-sized integers
  6. Function pointers
  7. Target type new
  8. Target type conditional
  9. Static anonymous methods
  10. Covariant return types
  11. Lambda discard parameters
  12. Attributes on local functions
C# 10.0

.NET Framework: .NET 6.0

Visual Studio: Visual Studio 2022

Important Features:

  1. Record structs
  2. Improvements in structure types
  3. Interpolated string handlers
  4. global using directives
  5. File-scoped namespace declaration
  6. Extended property patterns
  7. Improvements in lambda expressions
  8. Allow const interpolated strings
  9. Record types can seal ToString()
  10. Improved definite assignment
  11. Allow both assignment and declaration in the same deconstruction
  12. Allow AsyncMethodBuilder attribute on methods
  13. CallerArgumentExpression attribute
  14. Enhanced #line pragma
What can C# do for us?

Well, the answer is, a lot. I would say, nearly anything. Unless you’re writing non-Microsoft platform-centric code, C# can pretty much be used to write Windows clients applications, Web applications, Mobile apps, Enterprise software, backend, and service-oriented applications.

What can C# do for us?

The following image demonstrates the C# world and applications ecosystem.

C# Applications Ecosystem

As you can see from the above image, the C# language can be used to build any and all kinds of applications. Not only Windows or Web applications but C# can be used to build mobile, Windows Store, and Enterprise applications. C# can also be used within the SQL Server database to build reports, jobs, and modules to do the backend work.

Here is a list of types of applications C# can develop.

  1. Cloud-native apps and services 
  2. Windows client applications
  3. Windows libraries and components
  4. Windows services
  5. Web applications
  6. Web services and Web API
  7. Native iOS and Android mobile apps
  8. Backend services
  9. Azure cloud applications and services
  10. Backend database using ML/Data tools
  11. Interoperability software such as Office, SharePoint, SQL Server and so on.
  12. Artificial Intelligence and Machine learning
  13. Blockchains and distributed ledger technology including cryptocurrency
  14. Internet of Things (IoT) devices
  15. Gaming consoles and gaming systems
  16. Video games

In the next article, I am going to discuss .NET Framework Architecture and Components. Here, in this article, I try to give a brief Introduction to C# Language. and I hope you enjoy this Introduction to C# Language article.

Leave a Reply

Your email address will not be published.