What is .NET?


I. Introduction

I wrote a blog almost a year ago - What is .NET .

That blog was basically written according to the translation of the official document, and added some of my own understanding and complaints. Looking back now, although the content is comprehensive, it remains on the surface. (equivalent to answering what it is and what it contains)

What does that mean?
Through that blog, you can know. NET is Microsoft's development platform, which includes a variety of tools.
But why would Microsoft develop such a platform? How did this platform work? How is it different from other platforms/technologies like Java?
There seems to be no way to answer these extended questions.

This article mainly focuses on these issues to discuss and further understand .NET.


2. What is .NET

.NET, which is a developer platform created by Microsoft for building many different types of applications.

1 Why Microsoft developed the .NET platform

This question is easier to understand.

We all know that Microsoft was almost monopolized in the PC operating system market in the early days.
It is not enough for a computer/computer to only have an operating system, but it must also have application software on it. Of course, Microsoft itself cannot develop all the software that users need. Although we cannot develop all the software, we can develop a platform for people in need to use this platform to develop software. In the final analysis, Microsoft technology is used, and the lifeblood (upper technology/meta technology) is still in the hands of Microsoft.

Of course, it all comes down to money. Occupy the market and expand new business (application software) based on existing business (OS).

In fact, this step has to be taken, because Java was launched in 1995, .NET appeared in 2000, and Java was quite popular from 1995 to 2000. If .net does not appear for a long time, Microsoft may be severely hit and lose a considerable part of the software market. It can be seen that the emergence of .NET is to compete with Java.

In the end, because of the emergence of .NET, at least in PC-side desktop applications, Microsoft retained its dominance. As for other aspects (mobile terminal, web terminal), Microsoft does not have an advantage due to layout issues.

As for making it easier for programmers to develop programs, this is what .NET must achieve (.NET must be easy to use before someone can use it; otherwise, everyone can write assembly and develop applications). That's not why .NET came about, and Microsoft isn't doing charity.

2 How .NET is implemented

Or what language is it written in.
The .NET mentioned here certainly does not refer to the entire .NET platform, it is more like referring specifically to the CLR.

Before that, let's talk about the compilation process of C language, which should be familiar to everyone.
Simply put, preprocessing => compilation => assembly => linking.
It is a process of converting high-level language code into machine code understandable by a computer.

Obviously, .NET will eventually generate computer-understandable machine code, so it will inevitably go through one or more of these processes. A higher-level (this high-level does not mean how advanced or superior the language is; it refers to a higher level of abstraction) language (language compiler), usually written and implemented by a lower-level language. The core runtime environment CLR of .NET is no exception, it is written by C/C++ and assembly.

Digression - bootstraping (bootstraping)


Everyone should have heard that "everything in the computer is made up of 01".
But it is impossible for people to program directly with 0 and 1, so assembly appeared.
Assembly Language (Assembly Language) is a low-level language corresponding to machine language. It uses mnemonics (English abbreviations) to replace the binary code of machine instructions, which is easier to understand and write. Obviously, this is easier to understand in relative terms. Anyone who has read the assembly should know that its codes are all instructions, such as mov and jmp, and the readability is still not very good.

So the C language appeared. According to the above, high-level languages ​​are usually written and implemented by low-level languages, so the C language (C compiler) is written by assembly?
In fact, the current C compiler is generally written in C.
? ? ? C writes C itself? What is it that compiles the C compiler?
If you have to trace the source, it should be said that the earliest C compiler was written in assembly. Initially, assembly language was used to write a C language compiler, and this compiler was the ancestor of the C compiler. Later C compilers were written using C combined with this C compiler.
In fact, if you have learned the principles of compilation, you should know that there is a word called bootstrapping :
we first use the underlying language to implement a part of the upper-level language, called C0. Then use this part of the upper-level language C0 to implement other parts of C1; then use C1 to implement C2... and finally get a complete upper-level language.

After having the concept of bootstrapping, let's ask what is the .NET platform (this time refers to the entire platform) written? The answer is very expensive, C, C++, C#, assembly and so on.

3. What is the difference between .NET and Java?

.NET is a development platform; Java is a programming language.
There is nothing comparable between the two. If it is hard to compare, it should be compared with C# and Java.
But usually verbally (sometimes equating C# and .NET), there will indeed be comparisons between the two. At this time, it is usually about comparing .NET related technologies with Java related technologies.
Because the two do have many corresponding technologies, such as .NET has ASP, Java has JSP; desktop .NET has WinForm, WPF, Java has swing, Javafx, etc. Of course, they each have their strengths and weaknesses, and some technologies are not suitable for the environment and have been eliminated.

In short, I think both have their own advantages and disadvantages. C# is widely used in the industrial field; Java is widely used in enterprises. From the perspective of the current domestic environment, Java is hotter than C#, but this is not a problem of C#, it is caused by many factors such as ecology and history. At the same time, the Java job market is also getting more and more popular, with more applications from major domestic companies.


3. Conclusion

Strictly speaking, this blog is a bit off topic.
However, the expansion of understanding of the above points is still helpful for a comprehensive understanding of .NET.

Guess you like

Origin blog.csdn.net/BadAyase/article/details/129971160