CC ++ vs. java

zhaozj2021-02-08  286

C vs. java

Jy said:

Real programmers today (AD 2001) should be nasal to Java. The real programmer is a C programmer. Real scholars are ancient Pascal programmers (pay attention to do not talk to today,

Objective, the application is different, this should cause this article that it does not have to exist, the two are not the same level, and it is not comparable. However, for all individuals or selfish reasons, Java is subjected to improper propaganda, as a tool for attack. Therefore, I have to marisman.

---- Incoming ability ---- like C / C can adapt to a variety of programming languages, and today, this family is only.

From current view, and even foreseeable in the future, Java is impossible to do so adaptability.

---- Flexibility ----

Template C template is the second turning point in the history of C development (proposed C first). This provides you with a broad space, more favorable and code multiplexing. From this perspective, the poor polymorphism, inheritance, inheritance, in fact, only the early results of C just released, is there anything to be proud?

Naturally, the template is still difficult to understand, so that STL source has become a gantry that many beginners think that they want to cross.

Hardware capabilities do not have to have a hardware manipulation ability, just open MODEM, set an automatic answer to the number of ringtones, Java programmers will scratch the eager 耳, I don't know how it is good.

Therefore, the one-sided viewing Java is simple, it is easy to use it as easy. It is a big mistake.

---- Question of the basic grammar ----

---- Question of the class system ---- Java references the SmallTalk system, and the entire tree is growing from the Object element object;

C is different from this, you can have any multiple basic objects, and construct N-type tree out resources.

The correct opinion is that there are apart from all, it doesn't matter who is optimal. However, Java supporters emphasize all kinds of benefits from homologous, and the consequences of arguing are C supporters and the benefits of multi-tree.

I thought that this is the benefits of Java: causing these discussions, it can make theory be insens intogenous.

---- Imaginary Doubt ---- Java seems to develop a syntax of the polymorphic constructor. If this is true, I need to think about whether the object that is still in the construction should be polymorphic.

In order to write this small title, I further examined the relevant content. It turns out that Java is still moving the old rules, prohibiting the polymorphism of the constructor.

Instead, using the RTTI mechanism, Java can implement a "virtual build" function mechanism, basically completed using the main () entry point in the class.

Talking here, I thought that two solituded in a class (routine constructors and main) in a class (routine constructors and main) are really the failure of Java. Even in order to achieve a particular algorithm, it should not be promoted to the MAIN entry point in the class. This makes people feel awkward.

---- Class Finding Question ---- Java's class name Find algorithm is the choice of letting a well-trained wise man.

There is no need to mention the "java.lang.noclassdeffounderror:" of beginners: ".

Even if you are older, you will be hidden by inexplicable class name, and it is difficult to locate the fault.

In addition, Sun recommends that you pack your own package to use the step-by-step domain name, the reason is that the domain name is the only one.

Unfortunately, this is not a good choice if today's domain exchange and disputes are frequent. Due to the chaoticity of the domain name, the Chinese may have asked again. If I use the Chinese domain name, what should I do if my package? You can use the name "China. Wang Zhonghua .util.Vector"?

This, even if C is more than VB. VB (VBA) can use the full Chinese variable name, function name, etc. identifier naming!

---- Inheriting the nesting question ---- first see this example:

Class Outer {

Class inner {}

}

Class Childofinner Extends Outer.inner {

ChildOfinner () {(New Outer ()). Super ();}

}How do you feel? I am really difficult to understand. This grammar has destroyed the basic rules of the nested class: in order to hide the object of local characteristics, we declare a class declared as the Outer.

As the nested class, it is because in addition to Outer, it will not be hidden in Outer. Conversely, according to the above example, Childofinner derived from Outer.inner, what is intended? Expand the interface for the Outer.inner? It seems impossible.

Yes, this is an example in the SDK document of Java 2, and it is intended to explain the display constructor of the superclass.

But it is an example I have to question.

If you come back, this is not just a fault of Java. The same problem exists in C :

Class Outer {

PUBLIC:

Outer () {

_tprintf ("Outer () / n");

}

Class inner {

PUBLIC:

INNER () {

_tprintf ("inner () / n");

}

}

Inner Inner;

}

Class Childofinner: Public Outer :: inner {

PUBLIC:

Childofinner () {

_tprintf ("ChildOfinner () / N");

}

}; I have to say that the syntax allows this to do so, but this is unwise: I need to derive the subclass of the nested subclavé, and I will not appear once a hundred years.

Java was taken out of the target this time.

Look, Java's grammar has made so many restrictions, but it is open here, so that this grammar is survive. Is this not quite strange?

---- Pointer ----

Is the pointer really provoked? Yes, the pointer is really harmful. A senior C programmer, will never say that it has been impeccable to the use of pointers.

Starting from C, people turn thousands, or pointers.

From the pointer to discharge, how much brilliant and concise algorithm is born. And since then, how much vitality has been brought to computer history.

If the pointer is provoked, I don't know what all the various operating systems today do? Don't forget to be arbitrarily, the OS that is currently running, 100% are C or C plus ASM write.

How can people blame C with a bad pointer? Do not require you to use a pointer. However, how can I blame this language? How can I use a bad language mechanism and character?

Because it is not good to use a bad pointer, this language always causes memory leaks, which is extremely absurcted.

From another aspect, it is also a C , you can have different ways of use. Excellent programmers can write advanced pointer applications, while the first-door programmers can use a variety of successful class libraries, especially STL to address commonly used routine development, and avoid causing could not make good use of pointers. Therefore, the technical hand is actually picking technology. Usually we can only smile, he will not have a little childish, and it can be accepted.

Can people with a bad pointer can be called qualified C / C programmers?

I don't have a definitive answer.

GC = GARBAGE CONSTRUCTOR? !

From the performance of GC, it is indeed a garbage.

No stewed phagocytosis is basically equally a failure.

Attempting to direct GC enough to recover memory, it is a luxury, because dynamic pick-up memory algorithms, there is no sufficient intelligence to ensure that useless memory can be recycled in time.

For 24 × 7 real-time work, the current Java performance will not be satisfactory: you can enable GC to enable through special statement, but you still can't control the GC, which is stuck in front of the GC, until the memory When I finally exhausted, it may not do anything (in java 1.x, Finalize () has never worked as those claimed in the JDK document, but the article that is not counting, it is not possible to rely on Finalize () to complete the clear action you may have to do; GC's true "barely" in Java 2 meets its documentation, but it is more likely to cause oscillation *).

* The so-called oscillate is that the failed memory switching algorithm leads to continuous exchange between the memory and alternate storage, and the process that truly needs to be maintained does not have enough main memory. . Here is to borrow this concept to refer to the continuous recycling and redistribution of useless objects, and the truly requested request is not satisfied.

Java has a heavy cost that is paid to prevent incorrect use of pointers. This seems to be the same as the woman in the 20-year, and it is too far before, it is counterproductive.

If the hardware condition of the computer is further expanded, it is assumed that the foreseeable 5 years later, I believe that the cost of GC pays will not be worth mentioning. Today, in the case of the US, China, the world, it is still a small company, can you ask them to buy RS6000?

From this point of view, Sun is in catering to the taste of giant company, but it is necessary to set up the archway.

(IBM is fully migrating to Java, not let me surprise, if he is not, I am surprised: IBM desktop applications are relatively weak, mention IBM, probably no one does not know what is the blue of blue. Pair "Giants". "Giant" with Java in the giant machine, that is a perfect match. Poor I only have a 266 core.)

So, some people changed the angle and asked my cross-platform problem.

---- Cross-platform ----

Is the cross-platform really important when 90% of desktops use Windows? I don't want to discuss the MS company here, it is another article. Or, in order to prevent this topic from being unlimited, the subject is lost, I should take the words of Windows, change to Mac OS or Solaris, how?

When 90% of desktops use Windows, Sun is not happy, talk about platforms;

So, when 90% of desktops use Solaris, Sun naturally laughs.

However, how much is there in the cross platform? Guess it, will Sun talk to you at the time? Good people! Let's take a cross-platform ability.

Java is an exclusive one? No, C and C have such portability. The real programmer is grabbing, such as PHP, Apache, etc., is working in a variety of platforms.

Nice, C wants to cross the platform and basically does not modify the source code, it is impossible, as a advanced programming ability, most of the "C programmers" can not complete this task. There are both historical factors here, and objective reasons. The implementation version of C is much more, in order to give programmers more flexible to operate hardware, the custom extensions of various compilers also have a word, which is the difficult point of the current C source code wants to work across platforms.

Confused Java, as a oligarch, known as a written, in fact, is an uncommon dictation. Today's Java compiler is achieved, and there have been several versions. Sincere, we guess the general, version, cross-platform is weak.

It is not necessary to mention SUN alone until now, Java is not exactly a written objective at all.

No matter what, this kind of writing is more like a smile, a campaign that catering some people's hearts, a golden jade, and it is.

If you can't reach the goal, don't use it to deceive others, this kind of opportunity is just illegal and unethical, not what else.

---- GUI ---- I don't want to be more, anyway, the interface that Java is always so ugly.

This is not a habit, but the Java designer indifferent to the results of GUI design and humanity. At the same time, of course, this is also the inevitable result of Java is not mature enough.

For example, shortcuts, default buttons, focus switching, etc., such as color matching, such as working space layout, and occupation, failure from Swing, so applications based on Java foundation are almost unfriendly The interface, rough and simple.

Even the heavy products such as JBuilder can not be satisfactory.

---- Java's proud pen ---- Java's proud pen is still extremely very much, I only list three below, more no longer listening, this article is not intended to be papers.

The array Java is most worthy, maybe it should be the function of returning an array. Don't consider how Java is implemented, just watch this ability: Returning an array in C will bring considerable survival issues, in order to prevent drawbacks, it may have to complicate problems. Java's capability makes programmers to use particularly convenient algorithms more freely.

The GC mentioned the weakness of GC, but that is not our only point of view. As a mechanism, GC is a major improvement, which can be seen from the current freshly baked things, and the GC mechanism can be seen. Due to the presence of GC, the programmer can give up the care of more details, thereby placing energy in design for business logic, which is the absolute contribution of GC.

(Nature, the foreman shows my personal point of view: GC is advanced, but it is also green, now eat, will turn your teeth. I have a good idea to operate the pointer, so this is a personal point of view, I don't want to agree. .)

There is no mention of the text about the architecture in front of the system. This is because C itself acts as a programming language and does not involve problems in system design, but Java's complete connotation includes a large number of "fixed and recognized" design specifications and architectures. For a typical business application, the appserver provides the underlying frame support, JDBC provides access to heterogeneous data sources, and various workflow services are ready; JNDI provides a unified specification named universal access; etc. Wait. These, a good foundation for development.

Nature, the traditional view, this does not belong to the content of the programming language, I will not discuss too much.

As a complete solution and system, this is a unique advantage of Java. It is also its strong place.

As the convenience and power of Java, there are many examples. Please pay attention to our position: As a new language launched after so many years later, and refer to the various advantages of C , the powerful but not too small.

---- Beginner's misunderstanding ----

"Really written is enough." In that, the task that can be completed may be too toys, and there is no use value. Note: Don't understand the meaning of this sentence, don't treat your advertising as a real world.

"There is no pointer, it will not make mistakes." Where is it! Still have a lot of things you need to worry: Is the demand collection enough and accurate? Can it still adapt to the growth of a long enough demand growth? Is the architecture design reasonable? Is the design and elasticity of class? Is the algorithm selected appropriate? Is the branch logic correct? Does members have not initialized? Is there any connection to the network yet? Is it not considered the illegal data of the user? What should I do if my disk space is not enough? Does the design document match your code? Does your code meet the requirements of the design documentation? It is not a programmer on the window (form), not a programmer, not to raise a real programmer, this is just the last flow.

"Everyone can program". The biggest lie, this dream can never be achieved: while technological progress is also progressing. In the past, Zhuge can see the weather is Zhuge; Today, anyone listened to radio TV to know the weather, and it does not mean that everyone is Zhuge.

"Java is easy to learn". Why are everyone is willing to believe in lies without correcting the facts? This is easy to learn from C , and VB is easy to learn, it is quirky. There is always some people think that there is no payment, and there is a harvest. Sigh!

"Foreign companies have developed Java". is it? Hundreds of thousands of VB programmers, standing out to let Yes look. Then, let's take a few more professional programmers who can have a global, compare the real quantity of Java programmers, ok? The fact is, and regardless of the number of people developed, only the real focus of focus: foreign countries, is also a very small number of companies that have a name that have been mature and used to use Java to build their entire enterprise information platform. It is incredible in the first day of this, in fact, it is also very normal, historical and performance, and the cause of maturity. It is not a piece of millions of program code that represents the quality of the language, and the problem that the company's calculation needs to consider is not so rash.

Is the world's top 500 working model to adapt to your company's environment? Because there are several or dozens of Java systems in 500, should your company also use the Java system?

"It can be made." I am very unsure, people who hold this attitude will be killed by me. I have no national industries, but I hate this irresponsible attitude. Therefore, the development of mainland China is always a vicious circle, there is no quality, there is no progress; there is no progress and quality, so there is no order; there is no order, it is difficult to have, so there is further demand, hurry up, no one Efficiency; there is no quality and progress again. Finally, there is no thing showing something. At this time, personal power has been negligible, I have to let go of the decline of step by step. ---- End ----

Java's road is still very long.

To really have strength, Java has a long way to go. Java is still an immature specification. Simply listed an example: Nested class is a useful model, Java produced nested class is always named in OuterClass $ innerclass, notice that this will have problems in a considerable UNIX platform, because UNIX usually uses $ Symbol as a command line prompt. Solaris itself is a variant of UNIX, and Sun actually leaves this problem, and cannot be doubtful to his quality or dedication. (Now you don't have to worry about the name and prompt conflict, today is no problem), please, please see the discussion of the discussion of the FINAL. It cannot be reused by the user. Note that this shortage in Java 2 has been adjusted. While laughing, you should fully and completely recognize the immature of Java. Sun does not intend to protect your investment in early JDK. It is important to invest in Sun's investment and the preferences of Java, JDK designers. And the JDK and the current JDK at the time may not be too much, and a number of early code has been implemented today. A small example is generic, making many supporters enthusiastically looking forward to the Java version of the template mechanism to be implemented. These supporters waited until Java 2, but found that there is no trace of generic keywords. It can be expected that, on this, Sun will say that templates are complicated, so they don't plan to support this unappropriate thing. This is different from MS, and MS is not a person in charge of C , and MS has to suffer a considerable price in its own compatibility for so many years. What's more, Sun's documentation is compared with MS, simply short-selling shoes is not enough. The more excellent version of Java's STL is not produced by Sun, the index of Java documents, and the JBuilder, which provides a real search and directory. For me, the configuration of various packages that just started to do Java is simply a disaster, see if there is no error, but still can't find a class, now go back, of course, it is easy to use. . Sun may reflect on the monks who are not qualified to do Java. You already know that Java has a java figure at an attempt, and there is a problem everywhere. And Sun is really unique enough to support? Still caught in the license, do you open? This is the heart of Simma Zha. I don't mind that there is no ambition, I just want to suspect that Sun is still a company still relying on hardware products, is there so powerful strength to complete the wish of the Java in the world. And further, really a uniform world, is the blessings? Can Sun load this thousands of autumn? For a development specification (Java is more than just a programming language), I repeatedly wrote the immersion in the forebelt. I really want to emphasize you that before blind from Java, it should still be fine. There are still too many bugs in Java, and those who prefer it often do not face these problems. As a rigorous programmer, this is disappointing. Java brings us a small part of the technology, although it is slightly advanced, it is valuable. However, standing on the experience of predecessors, only such less improvements are still unable to meet. Sun is just unsuccessful, and there is a lot of business inadvertently, let alone show its ambitious. In this sense, it is more wasteful to debate whether Java is excellent. Even exaggerated, Java prospects are worrying.

The world is big, and the long-term must be, theirs will be divided. Java wants to keep Pure, it is a violation of rules. Once you can't keep it, under all flowers, today Java attracts a lot of characteristics will lose. ---- Against the monopoly ---- Many experience tell us that the unique choice can only be guaranteed by concentrated power, it is monopoly.

I have to write, the only specification, etc., there is such a blank that is not paying attention to others. In addition to fine think, you can find that lunch is free.

---- JY: In order to compare, this article only focuses on the partial situation in terms of programming language, and the insight is not unexpected.

In this regard, discuss a lot of versions, I didn't make any particularly unique ideas, and I don't have to have this luxury for me.

For the first time, because of hobbies and needs, transfer to Java, on the one hand, I don't believe in evil. I will learn will not be there; on the one hand, I don't believe in evil, Java is so good, really can make people like a big leap. So, this is just a learning notes.

Because it is actually notes, the tone is not avoided, and it is good for my bad morality.

Finally, thank you for reading this article, wasted your time is really regret.

转载请注明原文地址:https://www.9cbs.com/read-1754.html

New Post(0)