blog posts

.NET

Introduction to .NET programming And the difference with .NET Core.

.NET is a free and open source development framework for developing many applications. Join us to learn more about this framework. In this article, you will learn about. This framework and its architecture, learn about the differences between .NET CORE and .NET framework, and learn when to use it.

The birth of .NET

It was first published in 2002 with the announcement of a new language called #C by Microsoft. The original goal was to develop software applications on the Windows platform, but over time Microsoft began to policy on frameworks beyond Windows, and today . It is used to program other areas such as the web, mobile, and so on.

.NET Types: .NET Differences. And .NET Core.

It is presented in three comprehensive categories:

  • .Net Framework
  • .Net Core
  • Xamarin

.NET Framework

This is the original release released under the name it, which only supports Windows-based devices. Windows Forms and WPF are used to build applications in the desktop environment, but ASP.Net, which is very common in the industry today, is used to design dynamic websites and web applications. In fact, existence (CLR) gives developers the opportunity to write ASP.Net code using different .Net languages, which we’ll talk about later.

.Net Core

It is a restructuring of the previous framework, except that developers can use it in Linux and OS X to create applications that are not necessarily related to the Windows family. This new system seeks to conquer the cloud. In addition to .NET Core. Not only is it multi-platform, but different versions can be installed side-by-side on one device. NET Core includes ASP.NET Core and Universal Platform Windows (UWP).

Xamarin

Nowadays if you want to build an application using the this framework. Develop for mobile (Android, Windows Phone and iOS) will be the choice of many Xamarin developers.

.Net Standard

2016 was a fruitful year for developers; This year, in addition to introducing Xamarin and .NET CORE, a comprehensive library was introduced to combine the above three frameworks so that people can use a basic class library instead of mastering three different libraries. This is the integration step that Net Standard. So It is called, to create a higher ecosystem and compatibility in the reuse of components in different operating systems.

.NET architecture

The .NET framework architecture is based on the following three main components:

  • Common Language Runtime
  • Class Libraries
  • Language Programming Languages

What is CLR?

The Common Language Infrastructure, or CLR, is at the heart of it: a software virtual machine that manages memory, implements code access security, verifies code security, and executes programs and code. CLR is what makes it a management and multitasking framework, and is the platform on which applications run. It has the following key features:

  • Exception Handling: or managing errors that occur while running the program, such as: Trying to open a file on a local device while the file does not exist.
  • Working with different programming languages: As mentioned in the previous section, a developer can create an application in different types of .NET programming languages.

The different parts of the CLR are:

  • Language: The first level is the programming language itself, the most common of which are VB.Net and C #.
  • Compiler: There is a separate compiler for each programming language. So under VB.Net, there will be a separate VB.Net compiler. Similarly, for C #, you will have another compiler.
  • Common Language Interpreter: This is the last layer in it that is used to run a program built into any programming language. So the next compiler sends the program to the CLI layer to run the program.

Class Libraries

This Framework Includes a set of standard class libraries. So Libraries are a collection of methods and functions used for their original purpose.

For example, there is a library with methods for performing all file operations. So there is a way to use a file to read text. Similarly, there is a way to write text to a file. Most of these methods in .NET are into System or Microsoft names.

programming languages

Several languages, editors and libraries can be used within .NET; That’s why programmers have so many choices to develop their program. The most commonly used of these languages ​​are:

  • C #: A simple, modern, object-oriented programming language
  • Visual Basic (VB): A simple, user-friendly, object-oriented language with easy text for applications

Suitable environments for .NET programming

Visual Studio is the most comprehensive environment for its application development. The next option, which is somewhat lighter and used by most web developers, is Visual Studio Code. Rider, designed by JETBRAIN, is another option for choosing an environment.

Why do we use .NET?

to be independent

The main advantage of this framework is its independence from programming languages. Instead of  limitation to using a specific programming language, programmers can use it in any language that is compatible.

Support over time

Suppose you created an application in the older version of it, for example 2.0. And you try to run the same program on a device that has a higher version of the framework, such as 3.5. The program is still working. This is because with each version, Microsoft ensures that older versions of the framework are compatible with the latest version.

Portable

Throughout this article, we have mentioned many times that applications built with it can run on any platform, including Windows, iOS and Linux.

Memory Management

The CLR does all the memory management work. So The this framework has a high ability to find resources that are not being used by a running application, freeing up those resources through the Garbage Collector mechanism.

Easy deployment

.NET has tools that can be for packaging built-in applications. Eventually these packages are on client devices and automatically install the program.

high security

As you know, Microsoft values ​​security. Therefore, this Microsoft product is reliable against malicious attempts to change the compiled code.

Who should not go to this framework?

It is somewhat difficult for people unfamiliar with the world of programming to properly explain the operation of this framework. For people who are logical languages ​​like C, it is somewhat uncomfortable, because it is a framework consisting of object-oriented languages. For this reason, it may be better to go to this framework after mastering the concepts and deep understanding of programming.

Conclusion

It is a comprehensive and valuable collection with a bright future, and as promised by Microsoft, So we will see a comprehensive version of it by the end of 2020 that will be able to run and support a variety of operating systems, devices and applications.