The role of the .NET platform

Computer

When they say C#, they often mean the technologies of the .NET platform (Windows Forms, WPF, ASP.NET, Xamarin). And, conversely, when they say .NET, they often mean C#. However, although these concepts are related, it is wrong to equate them. The C# language was created specifically to work with the .NET framework, but the concept of .NET itself is somewhat broader.

Bill Gates once said that .NET is the best thing that Microsoft has created. Perhaps he was right. The .NET framework is a powerful platform for creating applications. We can distinguish its main features as follows:

Support for multiple languages. The basis of the platform is a common language runtime (CLR), so that .NET supports multiple languages: along with C# it is also VB.NET, C++, F#, as well as various dialects of other languages tied to .NET, such as Delphi.NET. When compiled, code in any of these languages is compiled into an assembly in the Common Intermediate Language (CIL), a kind of assembler for the .NET platform. Therefore, under certain conditions, we can make separate modules of the same application in separate languages.

Cross-platform. .NET is a portable platform (with some limitations). For example, the latest version of the platform at the moment – .NET 6 is supported on most modern operating systems Windows, MacOS, Linux. Using various technologies on the .NET platform, you can develop applications in C# for a variety of platforms – Windows, MacOS, Linux, Android, iOS, Tizen.

Powerful class library. .NET provides a single class library for all supported languages. And no matter what application we were going to write in C# – a text editor, chat room or complex website – one way or another, we use the .NET class library.

Variety of technologies. The common CLR runtime environment and base class library are the basis for a whole stack of technologies that developers can use to build different kinds of applications. For example, ADO.NET and Entity Framework Core are designed to work with databases in this technology stack. For building graphical applications with rich rich interface – WPF and WinUI, for creating simple graphical applications – Windows Forms. To develop cross-platform mobile and desktop applications – Xamarin/MAUI. To create websites and web applications – ASP.NET, etc.

To this it is worth adding actively developing and gaining popularity Blazor – a framework that runs on top of .NET, and which allows you to create web applications on the server side and on the client side. And in the future it will support the creation of mobile applications and possibly desktop applications.

Performance. According to a number of tests web-applications on .NET 6 in a number of categories strongly outperforms web-applications built with the help of other technologies. Applications on .NET 6 generally have high performance.

Also we should mention such feature of C# language and .NET frameworks as automatic garbage collection. This means that in most cases we will not have to worry about freeing memory, unlike in C++. The above-mentioned general-language CLR environment will call the garbage collector itself and clear the memory.

Edit