The .NET Technology: Benefits of the .NET Ecosystem and Useful Tips

Daring projects need the right set of tools to succeed. In this blog post, you'll learn what solutions can benefit most from using .NET technologies and whether .NET is suitable for your project. Alongside this, we'll take a closer look at the Dot NET developer platform and ecosystem and will find out more about the technologies it embraces.
  • 4 months ago
  • 11 min read

Let’s look at some statistics first. Enlyft has data on 219,800 companies that use Microsoft .NET in their tech stacks, including Accenture, Stack Overflow, and Trustpilot, just to name a few.

.NET remained in the top three technologies for businesses, according to the 2020 Statista report: .NET (35.1 %) and .NET Core (26.7 %) are at Node.js’ (51.4.%) heels. C#, one of the .NET main programming languages, is the 4th most popular language among developers, according to PYPL.

Most used frameworks, libraries, and toolsSource: inc.com

Are you wondering what makes .NET so popular? Let’s take a look.

A brief overview of .NET

.NET has been around for a while and includes lots of useful tools, so it’s easy to get confused by this abundance. Fortunately, we’ll do the heavy lifting for you and give a brief overview of the .NET developer platform, its history and components. If you are familiar with it, you might jump to the next section.

The .NET kickoff

In the mid 90ths, Microsoft worked on a game-changing concept of managed code, inspired by the introduction of the Java language and ecosystem (and willing to kill Java on Windows). As a result of these efforts, the company released the C# programming language in 2000 and .NET Framework in 2002. The new platform allowed developers to promote code security and robustness and manage some routine tasks (e.g., check the code, detect errors, automatically allocate and release memory for the application) by running code in an environment called runtime in Microsoft terminology.

Code managed by a runtime differs from unmanaged code, and here is how.

Unmanaged code

Code executed by the operating system (OS) directly is unmanaged. It is compiled straight to machine code to run on the specific processor architecture. Thanks to direct access to the hardware, such code is fast and powerful. But at the same time, it can be damaging and crash the whole system in case of an error. Another drawback is that it’s not portable – if you want to run the same unmanaged code on a different architecture, you should recompile it according to that architecture.

Managed code

Managed code overcame the disadvantages of unmanaged code:

  • It’s executed by the virtual machine (VM) component—the runtime—not the processor directly.
  • It’s portable as it is compiled into an intermediate language that doesn’t depend on the central processing unit (CPU) architecture.

Let’s look in more detail at how managed code works in .NET.

What is .NET (and what it isn’t)?

.NET is a developer platform and ecosystem, NOT a programming language or library. As a platform, .NET consists of two main components:

  • The Common Language Runtime (CLR)—the virtual machine/runtime component we mentioned earlier. It is an execution engine that runs applications. Apart from compiling and running the code, CLR takes care of automatic active memory management, object lifetime handling, security boundaries, cross-language integration, exception handling, type safety, and other forms of code accuracy.
  • The class libraries—a collection of reusable classes, interfaces, value types, and APIs closely integrated with CLR for all the .NET technologies list. Libraries provide functionalities and services to build different applications. It means that .NET development company and developers don’t need to reinvent the wheel—they can save time by using type libraries to handle everyday, low-level programming operations instead of writing code anew each time.

As an ecosystem, .NET comprises high-level languages that can run on top of it (32 so far), such as C#, Visual Basic, F#, etc., and several variations of CLR that we’re going to discuss further below.

.NET is also part and parcel of all Microsoft products: technology, services, cloud, and cloud-to-edge solutions. So with the help of .NET, these products can be customized to fit the particular needs of small, medium-sized, or large enterprises.

How does code turn into an application in .NET?

The journey of a .NET application starts with the source code written by developers in one of the languages compatible with .NET (most often, it’s C#). The code is first compiled with a native compiler for the respective language. Then this code is compiled for a second time into language-agnostic Intermediate Language, or IL for short (also called Microsoft Intermediate Language (MSIL) or Common Intermediate Language (CIL)). The compiled code and code’s metadata that describes the classes, methods, and attributes (such as security requirements) are stored in files called assemblies.

After this, CLR comes into play. It takes the assemblies and performs Just-In-Time compiling, or JIT-ing of code from IL to machine code. Simply put, CLR compiles the code fragments that are about to be executed (hence the name “just-in-time“), and then they are cached and reused later without the need to be recompiled.

What is .NET framework?Source: dotnet.microsoft.com

.NET—a unified platform for all types of applications

For almost two decades that passed since its first release, the .NET platform has evolved and transformed itself to adapt to the times. The first implementation was .NET Framework, which is, in fact, not a framework but a runtime variation. It supports running websites, services, desktop apps, and more on Windows only.

As the cloud-first and mobile-first trends gained pace in the 2010s, Windows-only .NET Framework couldn’t meet those new demands. So in 2016, Microsoft released a brand new platform—.NET Core (called .NET 5 in the latest release), an open-source implementation for running websites, services, and console apps on Windows, Linux, and macOS.

To cover mobile app development, Microsoft acquired Xamarin at the end of 2016. This acquisition allowed .NET developers to create native or near-native mobile applications across major mobile platforms, including iOS, Android, and OS X.

Although every .NET implementation has its CLR and class libraries, they are still part of the .NET family, so code created for one runtime can also be executed by another runtime. It is possible thanks to the .NET Standard—a set of fundamental APIs (also referred to as base class library or BCL) that are common across .NET Framework, .NET Core, and Xamarin. Instead of having platform-specific dev teams, you can have one team that consolidates the code and adapts it to run on different platforms.

.NET core overviewSource: devblogs.microsoft.com

What the future holds for .NET

The .NET platform is moving towards unification around .NET Core. At the same time, Microsoft is not abandoning .NET Framework altogether. Even though version 4.8 released in 2019 was announced to be the last major update of .NET Framework, the tech giant will ship it with Windows and keep servicing and supporting it. So chill out if you already have .NET Framework apps — they are safe for now.

.Introducing .NET 5Source: devblogs.microsoft.com

Now let’s see what application types and technologies .NET has to offer and what pitfalls you might expect when choosing them.

Technologies and application models available with .NET Framework

As we mentioned above, .NET Framework is used to develop applications for Windows, web apps, console apps, and Windows services. It contains a lot of technologies that may be puzzling at first. But don’t worry, our cheat sheet will help you figure them out.

Windows Forms (WinForms)—a graphical user interface (GUI) class library to create desktop applications ASP.NET—a framework for building web apps and services.

ADO.NET (where ADO stands for ActiveX Data Object)—a database access technology that allows consumer applications to retrieve, handle, and update the data from various data sources.

Windows Presentation Foundation (WPF)—a UI framework that creates desktop client applications for Windows using Extensible Application Markup Language (XAML).

Windows Communication Foundation (WCF) helps build service-oriented applications relying on web services to send and receive data.

WCF is closely connected with the Windows Workflow Foundation (WF), where a workflow models a process as a hierarchy of actions called activities.

Despite its rich toolset, .NET Framework is becoming outdated. The companies that have existing .NET Framework applications can maintain them, port them to .NET Core or enrich them with other .NET implementations (thanks to the Standard Library we mentioned earlier). There are some technologies that .NET Core does not support, but they are quite rare.

What solutions will shine with .NET Core?

The majority of new applications are better off with .NET Core. It’s modular, stunningly lightweight, and fast. It makes your solution cloud-ready (meaning not only Azure but AWS, Google Cloud Platform (GCP), etc.), cross-platform, and container-friendly.

Currently, .NET Core is used to create:

  • console and desktop application
  • web applications and cloud services using ASP.Net Core
  • Universal Windows Platform(UWP) apps
  • mobile apps for iOS and Android

Outstanding Blazor

Blazor is an example that illustrates how stunning .NET Core is. It is a super-cool framework within ASP.NET Core for building interactive client-side web UI using C# instead of JavaScript (JS), another popular language for creating web-page UI. You may wonder what makes it so cool? Well, there are several reasons:

  • C# for the client and the server-side. It allows sharing code and libraries and having one team that uses the same instruments for both front- and backend.
  • A mix of native and web UI in hybrid apps. Both native UI components and web UI components for hybrid apps can be created using Blazor, so the .NET code for the entire app runs as a single process.
  • Interoperability with JavaScript. The app logic and server-side code written in C# can perfectly connect to the JavaScript client-side code, JS APIs, and libraries.
  • Lightning-fast performance. As Blazor is part of the ASP.NET, the developers’ code is compiled directly into machine code, unlike JS scripts that should be interpreted before being compiled.

Disadvantages of .NET

Apart from the many advantages of .NET, there are some drawbacks worth mentioning:

  • .NET better fits more complex solutions. Though .NET is almost indispensable for sophisticated solutions (e.g., enterprise or desktop apps), there are better options (PHP, CMSes, Python, Django, etc.) for simple projects like a basic web app or a website.
  • Microsoft software products may be more expensive. It may be costly to purchase Microsoft products only, but there are always less expensive alternatives to consider. For example, the .NET’s standard database—MS SQL Server—is high-priced but you can make use of other databases of your choice.
  • Microsoft hardware is costly. Windows servers cost more than their competitors’ offerings, but thanks to .NET Core it’s possible to take advantage of affordable cloud hosting from Azure, AWS, GSP, etc., or use Linux physical servers.
  • Not all .NET code is open-sourced. On the one hand, it is good as the tech company takes care of the platform’s stable work; on the other hand, Microsoft dictates the rules.

In a nutshell

Microsoft .NET is a software developer platform and ecosystem for building and running the front-end and back-end of desktop, web, and mobile applications for Linux, macOS, Windows, iOS, Android, and more.

The .NET developer platform includes three implementations/runtimes with frameworks and libraries for building applications: .NET Framework, .NET Core, and Xamarin/Mono. The .NET Standard Library, a set of API specifications, ensures that the same code can work on many runtimes.

Among all the implementations, .NET Core is an obvious choice for desktop, web, and mobile applications in the long run, especially for small and medium-sized enterprises (SMEs).

If you think that .NET is the way to go for your project, we’re here to help. Contact us and get an estimate of your project.

title
content