The difference between Java and. Net

Source: Internet
Author: User

We are right. NET's understanding can be summed up as follows: At first it was a clone of the Java Platform (note platform, not to be confused with the Java language), then evolved slowly, with its own characteristics. The most notable feature of the Java platform is "platform independence" (or, no one knows who invented the write Once,run anywhere). In theory, you can write a program that runs on any operating system that has a JVM installed. Most people think. NET is modeled after the great concept of sun, platform independence, which competes with Java. And then some people don't know where to draw the conclusion that even if there is a non-Windows platform like Mono. NET CLR, there are many. NET programs can not be ported to other operating systems, such as WinForm can almost not be ported to Linux through Mono, so come to a shocking conclusion: Microsoft even imitation is not complete imitation, incredibly is pseudo cross-platform.

The above is the most recent conclusion I have ever seen:. NET's Achilles heel is that it's not really cross-platform. To this end, I have the following remarks:

(1). NET platform is not meant to support cross-platform, it appears only to optimize the traditional Windows development model, making Windows development more convenient and fast. It solves the problem of DLL Hell in COM times (. NET assembly Versioning), integrates multiple languages (convenient for a wide variety of programmers), can communicate without hindrance between components (assemblies) written in each language, set up OB ject-oriented and component-oriented, you can from one component (DLL To derive a new type without requiring all of the source code of that type (which is not possible in this unmanaged ERA), truly binary compatibility (you change one of the public members of the Assembly, if the client program using the assembly does not use this open member, Then the client does not have to recompile at all, providing memory management that is not in C + +, supporting exception handling, and so on. Strictly speaking, Microsoft releases. NET's first day is for its windows, there is no plan to let you write the program running on other operating systems (Microsoft so far has not released the official non-Windows platform of the. NET CLR).

(2) Besides the Java platform and. NET goal, the former from the beginning to think: In the internet world, I want to let a language run in any one operating system, and the latter that: in the internet world, I want to make all languages run in the same operating system (Windows). Two platforms were designed from the outset to be different.

(3) The emphasis of the two points is different:

As shown above, the red section is the function that other people extend out.

(4) above 3, the platform structure is similar, I do not know whether Microsoft has plagiarized Java, but it is certain that if the two owners of the original intention, two platforms can be "cross-platform" and "Support multi-language". As for why the use of mono can not be put some. NET program porting to Linux, this is easy to explain, Microsoft has not intended to migrate. NET programs to other platforms,. NET contains a number of rich frameworks are closely related to Windows, you use these frameworks, it is difficult to translate them into non-windows The code that can be executed in the platform. Moreover, Java is not a complete cross-platform, it is related to the framework you are actually using to develop. There are two of places where the above cannot be ported, one is the framework that you use when you develop, one is the CLR (or JVM), to see if the latter has the ability to translate the former into executable code for the corresponding platform.

In summary, two platforms have different emphases, do you think it is useful to compare apples and bananas?

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.