Java alternative to C language possibilities

Source: Internet
Author: User
Tags account security

Not long ago, Csdn published a "C language is dead" article, causing some controversy. In fact, that article is from the Ed Burnette blog, the original title is "Die, C, die!", literal translation should be "Go to hell, C!" , it is a curse, not an inference. The translation of "C language is dead" is obviously a kind of fanning the wrong reading. Csdn netizens have criticized his point of view, but frankly, because these criticisms are based on a distorted translation, there is no novelty and no focus on the original author.

The reality is this, in the recent period of time, in the foreign technical community blew a wind, many people are talking about Java as a C-language alternative to become the most mainstream of the basic software programming language possibilities. From the point of view of most people, the trend for Java to replace C is still supported.

The basic software is a kind of software, its main task is to give full play to the potential of the computer, for the upper application software to provide an efficient, reliable feature set. These software will be called intensively, and a little lag in performance will be magnified by hundreds of times in practice. So for basic software, performance is at least as important as reliability. We are in the source of some basic software, often see some ugly design, see some perverted hack skills, in other areas, this is not encouraged, but in the basic software, this is reasonable, acceptable.

The C language is still strong in some areas, and it may be the Forever King in terms of operating systems, virtual machines, and device driver development. However, in other basic software fields, such as database, Web server, graphic image processing, C language continues to occupy the supremacy of the reasons for the fact that there are only two, one is fast, the second is familiar with more people, and experienced.

But these two points have now been challenged.

The first is speed. Java is running at a JDK1.4 level, which is that for a general-level developer, the C + + program he writes is no longer faster than the equivalent Java program. Subsequent JDK 5.0 and 6.0 further improved operational performance, and multiple evaluations conducted by different organizations showed that the overall operational efficiency gap between Java and C was less than one--that is, the C language, known for its speed, and to give up a lot of things for speed, Today is less than a few times faster than a fully-equipped java. This is not the case, assuming that given the new computing environment, the speed advantage of the C language may be just an illusion. Because, only very few people in the world have the ability to write fast and correct large programs in C language on multi-CPU computing platform, among these people, only very few and very few people have the ability to write a large-scale parallel program in C language which can give full play to the computing ability of each node in the large and heterogeneous network environment. In other words, you may have the ability to increase the efficiency of the program a few times, so as to give full play to a value of 6000 Yuan pc computing potential, to save customers 1000 yuan. But assuming that a large heterogeneous network of 1000 machines in parallel computing environment, you write the C program is probably far less performance than the corresponding Java program, not to mention the huge late maintenance costs, and the resulting loss may be 10 million or many others.

The second is experience. A lot of people are claiming their C skills, but in fact, even the real C master has to spend considerable time to find and debug errors, especially memory errors. Most of the software on the scale written in C has some memory errors, and it takes a lot of effort and time to stabilize the product. This has not taken into account security flaws, and today most developers have very weak knowledge of code security, which is quite common in the code, and in C, this deficiency is particularly noticeable. The biggest challenge may be the concurrency problem, concurrency is a very complex problem, it needs to be solved at a fairly high level of abstraction, and the abstract mechanism of C is too simple to provide high-level abstraction, so developers can only construct concurrent programs from some "concurrent primitives". This is no different from saws a big tree with a pencil, and it is straightforward to say that most C-program apes simply do not have the ability to write efficient, defect-free concurrent programs.

So the cruel fact is, when a person says his C language how, experience how rich, very likely he said, oneself in C language to write single-machine, single-threaded, will not be attacked by the outside, in the time budget no pressure, And the user can endure a very long product stability period of the application is very experienced. Unfortunately, the market environment and the computing environment have changed completely. In the face of more complex computing environment, using C language to write high-quality large-scale software, is only a real expert team to complete the work. Assuming you've had a few days of hard tracking and debugging a memory leak, or a threading error, you'll understand that you might not be the expert.

In contrast, Java, in terms of abstraction mechanisms, infrastructure, security, and concurrency, compared to the C language, is like the Mark Qin heavy machine gun to the bow and arrow. Concurrently, Java 5.0 adds the Java.util.concurrent package, which is probably the most powerful support library for concurrency issues in the mainstream language today. The memory management and security mechanism of Java has been proved by practice that white can effectively reduce the defects of the program. This is the intention of the original article of the curse.

So, my attitude is clear, I think Java alternative C is a progressive idea, but the world's progress is very many ideas, can dream come true but few. Can Java really be a powerful alternative to the C language in the field of basic software? I don't think I can do it at least for a short period of time because of the following:

1. People's problems. The person who can write excellent basic software in C language is not many, but the person who writes out in Java is afraid to be less. Java has a good millions of developers, but what are they doing? Most of it goes to enterprise-level development, web development, how many people really understand the Java memory model? How many people can skillfully use the tools provided in the concurrent package? A lot of people who have been using Java for many years have not written the socket program, don't understand the overhead of Java multithreading, and don't know how to perform diagnostic and tuning, which is a necessary skill when writing basic software. Most Java program apes turn to web development after they have just learned Java, devoting their main energies to mastering one large, complex, thick layer of abstraction and ornate structure, not only frameworks the real computer architecture, The computing environment for Java virtualization is unclear. Therefore, it is difficult to turn Java community programming into a vanguard that can take on the next generation of basic software development, and must spend enough time.

2. The memory consumption of Java is too high. For system-level programs, memory consumption is significant, which means that the cache hit ratio is reduced, the likelihood of exchanging data with the disk increases, and the impact on performance is more severe. Today, very many people still think Java is slow, the basic reason is not the Java run slowly, but because of the memory consumption caused by the comprehensive performance decline. This problem is not solved, Java can only be used to do some of the upper level of the basic software. Perhaps with the development of computer hardware, this problem will be solved gradually?

3. The question of style. I think the problem is the most serious one. Basic software development advocates freedom, direct, transparent, simple, efficient, like a dagger, Ruili, like a warrior, as brave as a peasant, as simple as a farmer, against the tedious design, opposed to the layer of the bed overlapping layers of abstraction, against the complex structure and unnecessary flexibility. The design style that the Java community has formed over the years is incompatible with this, and can even be said to be antagonistic. Java is ideologically oriented to enterprise application software development, so special emphasis on architecture, emphasis on design patterns, emphasis on standards, emphasis on the normal, high posture, emphasizing a luxurious court temperament. In C, you eat is to eat, hold up a bowl to drink, put down chopsticks dozens, off grab meat, roll up the sleeves to grease. And in Java, you often in order to do something, first new object, and then with this object for the parameter new also has an object, so repeatedly n times, get the object that really need, finally is to call that object of a method, like eating incense wash noodles, gargle hands, trembling, respectful. In C, encounter problems like fugitive, like a rogue version of the gold, tube you 3,721, rushed to is the kick, but also afraid of splitting you ya. In Java, encounter problems like Songxianggong, to prizes polemic, to be justified, to the state of etiquette, to the shelves opened, the some numbers set foot. Java's slogan is, regardless of the death of splitting, first put your boy moved to say. This tedious set of things, for basic software development, is neither necessary nor very difficult to get used to. The point is that this is not a Java language problem, in fact Java itself does not have to be so complex, so baroque. In terms of language itself, Java can also be brisk and direct, but also hearty. Just more than 10 years, almost no one has used this, so we have no idea: assuming not a step three kowtow, then how to use Java to hit the code?

It is because of the above-mentioned reasons (may not be comprehensive), until recently, the first-rank basic software is almost all written in the C language, or at least its core part is mainly C. And I think that in the short term, such a situation will not change greatly. Of course, if the Java community can overcome these problems, give full play to the advantages of Java itself, in the basic field to develop a large number of first-class supporting software, then the situation can be changed, and this change is also progress, is welcome.





Java alternative to C language possibilities

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.