C, C + +, Java differences

Source: Internet
Author: User

Often hear people complaining about where the language is bad, and how good the language is. I just laughed at the complaints. As far as I am concerned, language is only a tool, no good or bad. As long as you use the appropriate language to complete the corresponding work, then your goal is completed. We need not complain about the shortcomings of the language, but should accept the attitude. The existence of any language has its rationality, if unreasonable is not to stand the test of time. All things in the world have double-sided nature, just look at the advantages or disadvantages. If a thing is perfect, then I do not hesitate to tell you that one situation is that it does not exist, another situation is that you have not found its shortcomings. Each language has its own unique advantages, of course, the shortcomings are accompanied.

C language is the evergreen vine of the computer world. C language execution is very efficient, used to write the underlying driver that is suitable. Pointers are the essence of C language. and C + + is very powerful, as long as you are a master, you can almost use C + + to accomplish anything. Of course, virtual function is the essence of C + +. Java cancels the pointer, this should be happy or worry. The joy is that there is no such thing as C or C + + that is cumbersome for memory, and it also reduces the probability of a lot of fatal errors occurring. The worry is that the efficiency is greatly discounted, the use of virtual machines to make Java has cross-platform features, will inevitably make efficiency down. Another aspect, do you borrow other people's things to use (memory), should not return it? In this regard, C or C + + design ideas are more meaningful. Often focus on Tiobe world programming language rankings, Java has been a long time ranked first, I think this ranking is just a look, no need to believe too much.

Here's a look at the pros and cons of several major languages.

C language

The advantages of the C language:

1. Simple and compact, flexible and convenient

2. Rich operator

3. Rich data structure

4. C is a structured language

5. C Grammar restriction is not very strict, program design freedom is big

6. The C language allows direct access to the physical address and can be operated directly on the hardware

7. C Language Program generates high code quality, high program execution efficiency

8. C Language wide range of application, portability is good

9. C language has a prominent advantage is suitable for a variety of operating systems, such as DOS, UNIX, also applicable to a variety of models

10. Effectively break down a more complex program system Design task into many sub-tasks that are easy to control and process, so that it is easy to develop and maintain

Disadvantages of the C language:

1. The shortcomings of C language are mainly manifested in the encapsulation of the data, which makes C has a great flaw in the security of the data, which is a big difference between C and C + +.

2. C language Grammar restrictions are not strict, the type of variable constraints are not strict, affecting the security of the program, the array subscript out of bounds do not check. From an application perspective, the C language is more difficult to master than other high-level languages.

3. reusability is poor

4. Poor data security

5. Difficult to develop large-scale software and graphical interface of the application software

6. Separation of data and processing of data into mutually independent entities

7. When the data structure is changed, all related processes are modified accordingly.

8. Every new method relative to the old problem brings additional overhead

9. Graphical user interface applications that are difficult to describe and implement in a process, and are difficult to develop and maintain

C++

C + + Benefits:

1. Strong scalability

2. Efficient, concise and fast

3. Portability

4. Object-oriented features

5. Strong and flexible ability to express and not lose the efficiency of C

6. Support Hardware Development

7. The relationship between the program modules is more simple, the independence of the program module, the security of the data has a good guarantee

8. Through inheritance and polymorphism, can greatly improve the reusability of the program, making software development and maintenance more convenient

C + + Disadvantages:

1. Lower level, ease of use is not very good

2. Multiple inheritance and friend mechanisms

3. Inadequate coverage of the standard library

4. Long Development cycle

5. Non-parallel

6. Difficulty in mastering

7. Insufficient particle size encapsulation

Java

Advantages of Java:

1. Simplicity

2. Object-oriented (the degree of object-oriented can reach 95%)

3. Robustness

4. Cross-platform

5. High performance (automatic garbage collection mechanism)

6. Multithreading

7. Dynamic Nature

8. Security

Disadvantages of Java:

1. Low efficiency (no doubt)

2. Cross-platform is its biggest advantage is also the biggest disadvantage

3. Complexity (doing a project requires a lot of knowledge, covering a wide range)

Many times, the advantage of a language is likely to be its shortcomings, shortcomings may be its advantages. It depends on where you think you are. This confirms that the sentence, everything is not necessarily. No matter what language it is, as the beginning of the article says, if you use him to achieve what you want, you will succeed. There is no need to pay too much attention to its shortcomings, not to praise its merits. So I can only say that there is no point in fighting a better language on the Internet. Language is only a tool, there is no good or bad points.

C, C + +, Java differences

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.