Summary: in this tutorial, you’ll learn about the C# programming language and various .NET platforms.
Introduction to the C# programming language
The C# (/si ʃɑːrp/ or see sharp) is a general-purpose, type-safe, object-oriented programming language developed by Microsoft.
C# allows you to develop the following applications:
- Websites
- Desktop applications
- Mobile apps
- Command-line programs
- Cloud-based systems
- IoT devices
- Machine learning applications
- Games
C# first appeared in 2000 with the introduction of the .NET framework 1.0. For almost two decades, developers have been using C# to develop applications on Windows.
In June 2016, Microsoft released .NET Core 1.0, a cross-platform version of .NET, allowing you to develop applications that run across platforms, including Windows, macOS, and Linux.
In the early day, C# was closed. However, today C# is open. Microsoft welcomes the community’s contributions to the C# language. The community can propose new C# language features on GitHub, enabling open discussions and involvement from the earliest stage.
Why C#
Many programming languages are available today. Each language is suitable for a set of applications. Sometimes, you’ll see the overlaps.
However, programming languages are just tools that help you build applications productively. Therefore, selecting the right tool will help you speed up the development.
C# balances simplicity, expressiveness, and performance. The goal of C# is to help you build applications fast.
Understanding .NET
.NET framework, .NET Mono, .NET Core are closely related and overlapping platforms. It’s essential to understand each of them and what they can do before developing applications.
.NET Framework
Microsoft developed the .NET framework that includes two main components:
- Common language runtime (CLR) that manages the code execution.
- Base class library (BCL) that provides a library to build applications.
The .NET framework can work only on Windows. If you develop new applications, you should not use the .NET framework.
.NET Mono
The open-source community developed an implementation of the .NET framework called the Mono project. Mono is open and cross-platform. However, it’s often behind the official implementation of the .NET framework.
Mono project is a foundation for the following popular platforms:
- Xamarin mobile platform
- Unity game development platform
Microsoft acquired Xamarin in 2016 and included it in Visual Studio for free.
.NET Core
Microsoft developed a specific version of the .NET framework that works cross-platform called .NET Core. The .NET Core includes the cross-platform implementation of the .NET framework, including:
- CoreCLR is the cross-platform implementation of CLR
- CoreFX is the cross-platform implementation of BCL
But any improvements that Microsoft makes to the .NET Core cannot be added to the .NET framework. Therefore, Microsoft planned to unify all the .NET platforms.
A unified .NET platform
In November 2021, Microsoft announced a unified .NET platform. They renamed .NET Core to .NET.
.NET versions are either long term support (LTS) or current:
- LTS releases are stable and have fewer updates in their lifetime. LTS releases are a good choice for applications that you don’t want to update frequently. Microsoft supported LTS releases for three years after general availability, and 1 year after it ships the next LTS release.
- Current releases include features that include frequent changes based on feedback. Therefore, the current releases include the latest improvements. They’re suitable for applications that you’re actively developing. Microsoft supports the current releases for six months after a subsequent Current or LTS release. Since the releases happen every 12 months, the support period for a Current release is 18 months.
Microsoft will release critical fixes for LTS and Current releases throughout their lifetimes.
Summary
- C# is a general-purpose, type-safe, object-oriented programming language.
- Use .NET to develop new applications.