Pk between c ++ and java (c #)

Source: Internet
Author: User
The pk between c ++ and java (c #)-Linux general technology-Linux programming and kernel information. The following is a detailed description. 1. Who is good, who is bad?

Just as I did not expect to enter the java camp, it was unexpected to break into the c ++ camp this time. Many years ago, I was influenced by Microsoft, and I was almost a hardcore of Microsoft. I have learned from QB to c # in depth. I always thought that Microsoft's software is the most user-friendly and best. Two years ago, I accidentally walked into the door of java. Although I have learned java, I have always had the idea that this language cannot be beautiful. This step made me a loyal supporter of java. The open-source communities that support java are far more powerful than those of Microsoft. Compared with them, Microsoft's things (except operating systems) are the product of the Mechanical Age.

Moving back to the c ++ camp, there was a storm of worries. Whether the Linux creators despise c ++ or the application scope of c ++ is severely shrinking, I have to be scared. After more than a month of familiarity, I slowly recovered my feeling. We acknowledge that the application of c ++ is inferior to that of c # (java) and other languages without pointers, and the underlying c ++ is inferior to that of c and other fast languages. However, we cannot deny that c ++ runs faster than c # (java) after using many excellent libraries such as stl and boost at the algorithm level with high complexity, faster than c encoding. Note that c ++ has the advantage of c # (java) memory processing and the advantage of c speed.

If you want to write complex algorithms, c ++ is the best choice. If you only test the algorithm, you can use java (c #); if you want to run on a single-chip microcomputer, you can use c. However, if you want to develop the underlying algorithm of a program running on a pc, c ++ is definitely the best choice.

2. java programming features

The success of java fully benefits from its promotion in network applications. The majority of open-source camp brothers are also the main promoters of java. Although js has no essential link with java, js standards have become a java language propagandist. In comparison, java's own cross-platform features are not noticed.

Currently, the most successful java language has at least three aspects: 1) the speed of jvm is constantly improving; 2) the emergence of a large number of excellent ides; 3) countless open-source libraries. To put it simply, you can use java. A person who reviews the situation will not use c/c ++.

The biggest advantage of java is its continuous development. In the java World, it was already the world where j2ee distributed deployment, remote calling of rmi, reverse control of spring, and slice control of aop were never imagined by other languages. People who use java will always be at the forefront of technology!

For java programming, you must understand various architectures and various design patterns. For other languages, you may only need to know how to write functions. For example, a person who wrote code with c/c ++ for 10 years suddenly saw the java program. He looked dizzy and said there were interfaces everywhere, it's hard to see what's going on. He only understands the function level. Of course, he does not understand the java program based on the object level design.

3. Programming features of c ++

The biggest trouble with c ++ comes from the ide programming environment. In comparison, the programming environment of VS.net is already a leader in this field. However, you must install many plug-ins for it to reach the level of Java ide. If you haven't installed the automatic code prompt and code formatting plug-in for your vs.net, it means that you are still wasting your effort typing spaces (Code Daquan said above, programmers spend 30% of their coding time typing extra spaces ).

The biggest benefit of c ++ programming is that you can use the latest algorithms. Generally, people who study algorithms will use c/c ++ to build their code libraries. The reason is probably because those scholars are older and have never learned java (haha ). Therefore, it is much easier to find a basic data structure, such as the implementation of kdb-tree. In a centralized manner, c ++ is generated for algorithms. It is not suitable for you to use it to do anything else.

Most of the brothers who use c ++ are scared by the odd features of c ++. Whether the const that appears everywhere cannot be converted to a non-const, the constant cannot be converted to a reference, or some function pointers are 8 bytes, or the namespace is symbolic, odd behaviors in c ++ are hard to be enumerated. If you have never met, congratulations! You have become a top-level expert or you are still very inefficient at programming. Here we want to warn those who are complacent about understanding some of the peculiar properties of c ++, and do not learn these junk things. These odd features will certainly be abandoned. This is just as if you do not use the java method to mark as deprecated.

In c ++, you must pay close attention to naming rules (because ide does not tell you the true type of a name ). For yourself and for others' good.

4. Mutual Learning

To learn about c ++, you should read the following books: stl, boost, Objective c ++, c ++ prime, and code Daquan. To learn java, you should read the following books: design patterns, Software Engineering (such as Agile programming), java3 standards, and algorithm design. C ++ users generally regard themselves as low-level programmers and java users generally regard themselves as a designer. Although Junior c ++ programmers have higher salaries than junior java programmers. However, advanced c ++ programmers do not have a higher salary than advanced java programmers.

What is surprising is that java users generally have a deeper understanding of basic algorithms than c ++ users. I think it may be because the algorithms in java are open source libraries that are easy to understand. At the same time, if java wants to run fast, the algorithms must be considered. Of course, writing an algorithm in java is much faster than writing an algorithm in c ++. For example, almost everyone who uses java knows how dynamic arrays (ArrayList) work, but only a few people who use c ++ know how dynamic arrays work (vector ).

C ++ and java programmers are really far away from each other. Even the c ++ team will not communicate with each other for three months! This is almost impossible in java, and the idea will definitely change three months later.

According to the analysis, c ++ programmers should improve their own architecture capabilities, while java programmers should improve their understanding of the language and the ability to write code. Only by learning from each other can the software we write be free of spam.
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.