C #,

Source: Internet
Author: User

C #,

Preliminary Research on the underlying principles of. NET

Learning C # is inseparable. net platform, because Microsoft's development platform is really too powerful, it has done too much for every developer, But we not only need to know how to use it, in addition, you should know exactly what is included in it. This article not only describes some C # language knowledge, but also some operating mechanisms on the. net platform.

Compared with Java, Microsoft's encapsulation of C # language makes it hard for many people to understand it for a long time. For example, we know the encapsulation of fields in C #: The get and set attributes are used in the implementation of C, in Java, the get and set methods are clear at a glance. In fact, C # is implemented using the get and set methods, but it is encapsulated and invisible to everyone.

The following describes the underlying principles of C # language:

First of all, we need to know the operation of any language. In the final analysis, it is the operation of the machine language, that is, a large number of 01 numbers. The C # language relies on the. net platform to compile this advanced language into 01 code. So what is the C # language compilation process on the. net platform?

 


Actually. NET platform is equivalent to a virtual machine in Java. It uses the C # compiler to obtain the intermediate language (a special bytecode), and then runs through the JIT (just in Time) in the CLR) the editor is compiled into machine code to facilitate OS execution.

So next, let's take a look at what. NET contains?

 

The figure is. NET platform machine diagram, you can find. the core technology of the NET Framework is the common language runtime (CLR) and also contains the BCL (Basic Class Library) and.. NET.. net platform? In fact, all the above languages can write CLR-oriented program code. net is called managed code, and all managed code can run on CLR, with platform independence. Why is. net not cross-platform? For example, in Linux, why not implement asp.net or winform? In fact, it is because there is no CLR for Linux development (but mono seems to have been implemented, because I have not used it yet, that's why ,. net fails to implement cross-platform.

What content does CLR contain?

Base Class LIbrary Support: basic Class LIbrary Support

Thread Support: CLR supports multithreading (a multi-threaded application can be compiled using the service provided by this language ).

COM Marshaler: backward compatible

Type Cheker: Type-safe execution (any forced conversion that does not conform to the Type-safe operation will be checked. In addition, uninitialized variables and arrays that exceed the index will be checked automatically)

Exception Manager: Exception Handling Mechanism

 

The subsequent content will be gradually improved. Please stay tuned!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.