Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

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:
1. Modern and easy
2. Fast and open source
3. Cross platform
4. Safe
5. Versatile
6. 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
 Type Safety in .NET
 Write safe and efficient C# code
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.
 

VersionYear Features
1999- Modern, Object Oriented, Simple, Flexible, Typesafe, Managed, Garbage
1.0
2002 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

Compiler-as-a-service (Roslyn), Exception filters, Await in catch/finally blocks,


Auto property initializers, Dictionary initializer, Default values for getter-only
6.0 2015
properties, Expression-bodied members. Null propagator, String interpolation,
nameof operator

Tuples, Out variables, Pattern matching, Deconstruction, Local functions, Digit


separators, Binary literals, Ref returns and locals, Generalized async return
7.0 2017
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

Reference semantics with value types, Non-trailing named arguments, Leading


7.2 2017
underscores in numeric literals, private protected access modifier

Accessing fixed fields without pinning, Reassigning ref local variables, Using
7.3 2018 initializers on stackalloc arrays, Using fixed statements with any type that
supports a pattern, Using additional generic constraints

Nullable reference types, Async streams, ranges and indices, default


8.0 2019 implementation of interface members, recursive patterns, switch expressions,
target-type new expressions

C# Strings
 
In any programming language, to represent a value, we need a data type. The Char data type
represents a character in .NET. In .NET, the text is stored as a sequential read-only collection of
Char data types. There is no null-terminating character at the end of a C# string; therefore a C#
string can contain any number of embedded null characters ('\0'). 

You might also like