C# is a strongly typed object-oriented programming language. C# is open source, simple, modern, flexible, and versatile. In this article, let’s learn what C# is, what C# can do, and how C# is different than C++ and other programming languages.
A programming language on computer science is a language that is used to write software programs.
C# is a programming language developed and launched by Microsoft in 2001. C# is a simple, modern, and object-oriented language that provides modern day developers flexibility and features to build software that will not only work today but will be applicable for years in the future.
Key characteristics of C# language include:
- Modern and easy
- Fast and open source
- Cross platform
- Safe
- Versatile
- Evolving
C# is modern and easy
C# is a simple, modern, and an object-oriented programming language. The purpose of C# was to develop a programming language that is not only easy to learn but also supports modern day functionality for all kind of software development.
If you look at the history of programming languages and their features, each programming language was designed for a specific purpose to solve a specific need at that time.
C# language however was designed to keep business and enterprises needs in mind. C# language was designed for businesses to build all kinds of software by using one single programming language.
C# provides functionality to support modern day software development. C# supports Web, Mobile, and app development needs. Some of the modern-day programming language features C# supports are generics, var types, auto initialization of types and collections, lambda expressions, dynamic programming, asynchronous programming, tuples, pattern matching, advanced debugging and exception handling, and more.
C# language syntaxes are influenced from C++, Java, Pascal and few other languages that are easy to adopt. C# also avoids complexity and unstructured language features.
C# is fast and open source
C# is open source under the .NET Foundation, which is governed and run independently of Microsoft. C# language specifications, compilers, and related tools are open source projects on Github. While C# language feature design is lead by Microsoft, the open source community is very active in the language development and improvements.
C# is fast compare to several other high-level programming languages. C# 8 has many performance improvements.
C# is cross platform
C# is cross platform programming language. You can build .NET applications that can be deployed on Windows, Linux, and Mac platforms. C# apps can also be deployed in cloud and containers.
C# is safe and efficient
C# is a type safe language. C# does not allow type conversions that may lead to data loss or other problems. C# allows developers to write safe code. C# also focuses on writing efficient code.
Here is a list of some of the key concepts in C# that helps write safe and efficient code.
- Unsafe type casting is not allowed.
- Nullable and non-nullable types are supported in C#.
- Declare a readonly struct to express that a type is immutable and enables the compiler to save copies when using in parameters.
- Use a ref readonly return when the return value is a struct larger than IntPtr.Size and the storage lifetime is greater than the method returning the value.
- When the size of a readonly struct is bigger than IntPtr.Size, you should pass it as an in parameter for performance reasons.
- Never pass a struct as an in parameter unless it's declared with the readonly modifier because it may negatively affect performance and could lead to an obscure behavior.
- Use a ref struct, or a readonly ref struct such as Span<T> or ReadOnlySpan<T> to work with memory as a sequence of bytes.
References
C# is versatile
C# is a Swiss army knife. While most programming languages were designed for a specific purpose, C# was designed to
do C#. We can use C# to build today’s modern software applications. C# can be used to develop all kind of applications including Windows client apps, components and libraries, services and APIs, Web applications, Mobile apps, cloud applications, and video games.
Here is a list of types of applications C# can build,
- Windows client applications
- Windows libraries and components
- Windows services
- Web applications
- Web services and Web API
- Native iOS and Android mobile apps
- Backend services
- Azure cloud applications and services
- Backend database using ML/Data tools
- Interoperability software such as Office, SharePoint, SQL Server and so on.
- Artificial Intelligence and Machine learning
- Blockchains and distributed ledger technology including cryptocurrency
- Internet of Things (IoT) devices
- Gaming consoles and gaming systems
- Video games
Here is a detailed article What Can C# Do For You.
C# is evolving
C# 8.0 is the latest version of C#. If you look at C# language history, C# is evolving faster than any other languages. Thanks to Microsoft and a strong community support. C# was initially designed to write Windows client applications but today, C# can do pretty much anything from console apps, cloud app, and modern machine learning software.
The following table summarizes the C# versions with year and features.
|
Version
|
Year
|
Features
|
|
1.0
|
1999-2002
|
Modern, Object Oriented, Simple, Flexible, Typesafe, Managed, Garbage Collection, Cross-platform
|
|
2.0
|
2005
|
Generics, Anonymous Method, Partial Class, Nullable Type
|
|
3.0
|
2008
|
LINQ, Lamda Expression, Extension Method, Anonymous Type, Var
|
|
4.0
|
2010
|
Named and Optional Parameters, Dynamic Binding
|
|
5.0
|
2012
|
Async Programming
|
|
6.0
|
2015
|
Compiler-as-a-service (Roslyn), Exception filters, Await in catch/finally blocks, Auto property initializers, Dictionary initializer, Default values for getter-only properties, Expression-bodied members. Null propagator, String interpolation, nameof operator
|
|
7.0
|
2017
|
Tuples, Out variables, Pattern matching, Deconstruction, Local functions, Digit separators, Binary literals, Ref returns and locals, Generalized async return types, Expression bodied constructors and finalizers, Expression bodied getters and setters, Throw can also be used as expression
|
|
7.1
|
2017
|
Async main, Default literal expressions, Inferred tuple element names
|
|
7.2
|
2017
|
Reference semantics with value types, Non-trailing named arguments, Leading underscores in numeric literals, private protected access modifier
|
|
7.3
|
2018
|
Accessing fixed fields without pinning, Reassigning ref local variables, Using initializers on stackalloc arrays, Using fixed statements with any type that supports a pattern, Using additional generic constraints
|
|
8.0
|
2019
|
Nullable reference types, Async streams, ranges and indices, default implementation of interface members, recursive patterns, switch expressions, target-type new expressions
|




Govardhan PPosted Feb 20, 2020, 5:08 AM
A language to begin with what can be better than C#, also a language that can transform what user needs/demands and a developer can customize. That's simply superb!
Govardhan PPosted Feb 20, 2020, 5:07 AM
All about C# what one needs to know at one place with relevant links. Great and an awesome one!
Raju PaladiyaPosted Feb 19, 2020, 9:05 PM
Great Article !! Thank you for sharing
Pankajkumar PatelPosted Aug 29, 2019, 12:36 AM
Good one article
Anu MalikPosted Jul 10, 2019, 2:36 AM
Well Explanation...!!!
Osvaldo TomazPosted Jul 8, 2019, 12:48 PM
Great article Mahesh I love C# :))
Saroj Kumar SahuPosted Jul 8, 2019, 8:56 AM
Nice article sir. Thanks for sharing.
Jeeva SubburajPosted Jul 8, 2019, 8:33 AM
Thanks for the article mahesh. is C# cross platform language when they released 1.0? Open source Mono was released later in 2004 to run c# application on mac and linux. Now, with .Net Core, c# is truly cross platform.