Features and comparison of different programming languages

Source: Internet
Author: User

Pascal language:

Pascal is a general computer high-level programming language designed and created by Professor Niklaus Wirth in late 1960s.
Pascal's main features include: strict structured forms, rich and complete data types, high operation efficiency, and strong error checking capabilities.
Due to the above features, Pascal can be used to easily describe various algorithms and data structures. For beginners of programming, Pascal Language is beneficial to cultivate good programming style and habits. IOI (International Olympic informatics competition) regards Pascal as one of the three programming languages. NOI (National Olympic informatics competition) regards Pascal language as the only programming language to be promoted. In universities, Pascal language is often used as a mathematical language for learning data structures and algorithms.

C language:

C language is a high-level language between Assembly Language and advanced language, also known as intermediate language. It is a programming language that combines the advantages of assembly and advanced language. It was published in Bell Labs in 1972. Early C languages were mainly used in UNIX systems. People gradually understand the powerful functions and advantages of C language. In 1990s, C language began to enter other operating systems, and soon it has been widely used in various large, medium, small and micro computers. Become one of the best programming languages in the contemporary era.

C features

1. It is a structured language. Clear hierarchy, easy to organize programs in modular mode, easy to debug and maintain.

2. Strong presentation and processing capabilities in C language. It not only has rich operators and data types, but also facilitates the implementation of various complex data structures. It can also directly access the physical address of the memory for bit-level operations.

3. Because C language implements hardware programming, it can be used for system software development and application software development. C language also features high efficiency and portability. Therefore, it is widely transplanted to various types of computers, thus forming multiple versions of C language.

4. Since the C language allows direct operations on ing, byte, and address, most functions of the assembly language can be implemented.

5. High Target code quality and high program execution efficiency.

In general, the C language has the advantages of being concise, compact, easy to use, flexible, easy to learn, and applied. There are only 32 keywords. Nine control statements can be written freely.

Weakness of C language: Non-strong type; non-strict syntax restrictions, making programmers unable to rely too much on C compilation programs to check errors; lack of real-time checks, such as array out-of-bounds.

Strictly speaking, C is a block structure language because it is structured Like ALGOL, Pascal and Modula-2. Technically, the block structure language allows you to define processes and functions in processes and functions. Because C language does not allow defining a function in a function, it cannot be called a block structure language in the general sense.

C language, as a process-oriented computer language, has been widely used for more than 30 years. It is written in C at the underlying layer, regardless of Windows or Linux. Most network protocols are also implemented in C. The most beautiful game screen you see is also implemented by C, and the industrial control program is also implemented by C. However, C is not omnipotent, but it applies to some aspects.

C ++ Language

C ++ was developed by the AT&T Bell lab in 1986. The purpose of language development is to reduce the side effects of program variables through data encapsulation, thus reducing Program Complexity and improving program reliability. (I have heard that the purpose of C ++ development is because more and more people know the C language, so it is necessary to develop a more difficult and powerful language than the C language to save the job, so. C ++ was born. C ++ is a direct extension of C language. The multi-Inheritance Mechanism of C ++ can better describe the attributes and behaviors of objects.

C ++ is an extension of C, but C ++ can be used as a brand new language.

C ++ features: Object-oriented, inheritance, encapsulation, and polymorphism.

Because C ++ is an extension of C, it also has the characteristics of C.

On the basis of C, C ++ has added the object-oriented programming ideology, which determines that the efficiency of C ++ is not as good as that of C. For example, to define a type, C ++ uses classes for encapsulation, and C may directly combine several variables into a Struct. classes not only have member variables, it also has member functions and so on. When the efficiency is precisely compared, C will be more efficient than C ++. However, due to the development of the times and the scale of projects or projects, the object-oriented thinking is obviously more adaptable. That is to say, C ++ can do better in this respect than C. At present, many system-level programming is implemented using C ++, and many application-level software is also implemented using C ++.

Note that C ++ is not a fully object-oriented language. It provides object-oriented models and ideas, but is also compatible with process-oriented models.

Java language

The Java language comes from Sun's Green Project, which was originally designed to develop a distributed code system for household consumption electronic products, in this way, we can send emails to refrigerators, televisions, and other household appliances. Control and communicate with them. At the beginning, I plan to use C ++, but C ++ is too complicated and has poor security. Finally, I use a new language, Oak (the predecessor of Java ), oak is a sophisticated and secure language for networking. Sun once bids for an interactive TV project, but is defeated by SGI. The poor Oak was almost homeless. At this moment, Mosaic and Netscape developed by Mark Ardreesen inspired the Oak project team members who used (Java) to compile the HotJava browser and got Scott, Sun's CEO.
McNealy's support triggers Java's entry into the Internet. The name of Java has an interesting story: One day, several members of the Java member group are discussing the name of the new language. At that time, they were drinking Java (Java) coffee in the cafe, the name of Java came out as soon as it was said, and was appreciated by others.

Java features:

1. Simplicity: The style is similar to that of C ++. Java abandons the areas in C ++ that are prone to program errors, such as pointer and memory management.

2. Object-oriented: Java is a fully object-oriented language. From this point of view, Java is similar to SmallTalk, but its features, especially for distributed computing environments, far surpass SmallTalk.

3. distributed: Java includes a sub-database that supports HTTP, FTP, and other TCP/IP protocols. Therefore, Java applications can use URLs to open and access objects on the network in almost the same way as accessing local file systems.

4. Robustness: Java is committed to checking program errors during compilation and runtime. The type check helps to check for many early development errors. Java's self-manipulation of memory reduces the possibility of memory errors.

5. Structure neutral: Java compiles programs into a structure neutral intermediate file format. This intermediate code is executed on any machine running the system in Java. This intermediate language is designed to run on a virtual machine and executed by the machine-related running debugger.

6. Security:
1) The fragrance pointer and manual memory release functions are deleted to avoid illegal memory operations.
2) When Java is used to create a browser, the language function is combined with the function provided by the browser itself.
Before Java is executed on a machine, it requires a lot of tests. It passes code verification, checks the code segment format, detects pointer operations, whether object operations are excessive, and tries to change the type of an object.

7. Portable: Architecture-independent features allow Java applications to run on any computer system with a Java interpreter and runtime environment. Any Java code is interpreted as an intermediate language, and then runs the program through a specific environment (such as machine commands) of different machines. Features of easy portability.

8. Explanatory. The Java interpreter can directly run the target code commands. Linking programs usually requires less resources than compiling programs.

9. High Performance. If the interpreter is not slow, Java can directly translate the target code into machine commands at runtime. Sun uses a direct interpreter to call up to 300,000 processes in one second.

10. multithreading: The multithreading function provided by Java enables simultaneous execution of multiple small tasks in a program. The greater benefit of Multithreading is better interaction and real-time control performance.

11. Dynamic: the dynamic feature allows the program to dynamically load the classes required during the running process. The advantage of determining reference during runtime is that you can use updated classes without worrying about affecting the original code. If a program is connected to a class in another system in the network, the owner of the class can update the class without causing any program that references the class to crash.

Soon after the birth of Java, it was welcomed by the masses. Some people even said that with Java, it is not necessary to use C/C ++. Java was once mentioned in a very high position. Of course, this is a kind of appreciation for Java, but it is a bit too much. Today, Java still cannot replace C, C ++, and a new competitor,. Net (will be introduced later ).

Currently, Java is mainly used in Web browsers and network application systems.

C # language.

C # Is a precise, simple, type-safe, and object-oriented language. Speaking of C #, You have to briefly introduce. net. In the end, what is. net? According to Steve Ballrner, president and CEO of Microsoft, it is defined as:. Net represents a collection and an environment, which can be used as a platform to support the programmable structure of the next-generation Internet. C # is a representative language of. net.

C # features:

1. completely object-oriented.

2. Support for distributed systems. C # is supported because Microsoft believes that distributed applications are the future trend, that is, processing processes are distributed on clients and servers. Therefore, C # is doomed to solve distributed problems well at the beginning.

3. Similar to Java, C # code has become an IL (intermediate language) after compilation ). Compile IL as the platform-specific code at runtime.

4. Robust. C # is not inferior to Java in checking program errors and compilation and running errors. C # also uses an automatic memory management mechanism.

5. C # does not abandon pointer and manual memory management as Java does. C # pointers cannot be used by default. programmers can open pointers when necessary. This ensures programming flexibility.

6. Security: the security of C # is provided by the. net platform. C # compile the code to become the IL language. Is a type of controlled code.. net provides a type of security check mechanism to ensure code security.

7. Portability: Because C # uses an intermediate language mechanism similar to Java. So that C # is similar to Java and can be easily transplanted to other systems. During the runtime, the intermediate code is compiled into code suitable for specific machines.

8. Explanatory: C # is also a special explanatory language.

9. High Performance: After C # compiles the code into an intermediate language, it can efficiently execute the program.

10. multithreading: similar to Java, a main process can be used to separate multiple threads that execute small tasks.

11. Component Mode: C # is suitable for component development. Each component can be implemented in other languages and then integrated into. net.

C # Is a new language born after the popularity of Java. Microsoft has a great advantage in the operating system. In the past, I have accumulated a lot of experience in development and formed a. net platform. Therefore, C # has a greater advantage than Java in terms of Windows. Technically, C # can rival Java in network programming. C # also has some advantages in Windows Forms.

C # is a language that is very similar to C ++. The style is closer to Java. C ++ programmers and Java programmers can easily switch to C.

The strength of C # depends on the development of. net, and the development of. net depends on Microsoft's determination and investment in. net. From the Windows 2003 and Vista systems, we can see that (the former has built-in. net1.1, and the latter has built-in. net2.0 .). Net has an important strategic significance in Windows programming.

C # currently, it is mainly applied to network programming. Other fields such as database and form programming are gradually increasing.

Finally, the features of various languages have been written. If you do not agree with the above points, leave a message. Don't BS. I am right. Okay. Continue. I am going to talk about the theme!

Secondly, we assume that a beginner does not have any programming language foundation. First, let's take a look at the various languages:

Pascal PK C

Now, let's take a look at the process of learning Pascal and C: Learning Hello world, and then knowing how to compile and run it. Then, learn the basic data type, and then input and output. No matter how good the school expects the students to learn, actually, learning Pascal is no different from learning C. The difference is the language style. Some people may say that the essence of C learning lies in pointers. C is much better than Pascal. Yes, pointers are a key point of C learning. However, according to my C textbook, the pointer used is very simple. It is enough to understand the difference between * p and p. Then a few simple lines of code will be compiled, and you will think it will be C. There are many functions in the C library, and the teachers barely talk about them in class. For example, memset and qsort are missing. Learning Pascal is no different from C, but it serves as a foundation for learning other languages. As new students do not have a language foundation, many good students think that they have learned what they taught because they did not speak in class. This is the weakness of a good student. For "bad" students, they do not listen to the class. It may also find out how superficial C is in the classroom. Also, I have never seen a school teach C graphics development. Although graph development is not a language foundation. However, it is a good choice to extend the new programming horizon. Modern program software supports a wide range of graphic windows, and almost no one cares about the settings, positioning, and other functions of the form. Graphic programming can also arouse students' programming desires. I once implemented a C animation demonstration. When all the images in it are moving as expected, that kind of sensation is like the kind of ice water that you suddenly feel when you are in the ice and snow.

C pk c ++

C ++ is developed on the basis of C. It seems that the two primary keys, the winner must be C ++. Not necessarily. C still has room for survival, but it has not been fully replaced by C ++. It shows that C still plays an irreplaceable role. C is mainly used in the underlying hardware and applications with high performance requirements. However, for complex system-level development, C ++ is obviously comfortable. As a matter of fact, when many people learn C ++, they already have the foundation of C. With the foundation of C, you can quickly learn the basic types of C ++, and then learn concepts such as class, inheritance, and polymorphism. From my experience, I chose C ++ and almost never attended classes. Because I really wanted to go to bed, I used C ++ to do a big job before the end of the semester, C ++ is easy to take. In fact, I still didn't learn C ++ at that time. In essence, I am still on the basis of C. A structure type is added: class. After using C ++ for one year, I suddenly noticed my ignorance. To understand what C ++ is. I believe that many students who have learned C ++ think that the concept of I/O Stream is not clear yet. The reason for this phenomenon is: 1.
The students themselves are not programming seriously. 2. The instructor only repeats the lecture book. The final criteria for determining whether a student will take the C ++ test are the primary ones. I will give a personal opinion on the effectiveness of the examination system of colleges and universities in the computer system in the next few days.

Java pk c #

Many people talk about these two languages. When I started to learn C #, I had read the views of Java programmers on C. It makes C # worthless. Suddenly, it seems that many Java programmers are naturally hostile to C. I currently think I am proficient in C # (don't BS me ). I have learned Java before. Here I will write what I feel. Although Microsoft has always said that C # inherits from C/C ++, both the code structure and built-in support classes have striking similarities with Java. I feel that C # is designed based on Java to address Java's advantages and disadvantages. I have used C, C ++, and Java. I feel like C # is the best. This is just my personal experience. Since C # still retains pointers, one of the solutions is that C # Can open pointers while Java does not, java can only be solved through other approaches, such as optimization algorithms.

Java has achieved great success in non-windows environments: A Survey Company used the Google search engine to count the following indicators: the number of engineers who are proficient in a language, the availability of certain language courses, and how many companies are selling software written in a language. The final overall score is as follows: Java ranks first by 45.2; second by C and 32.2; C ++ ranks third by 24.6; C # lags far behind the ninth place, the score is 4.6. The data is from a few years ago. In this test, we also found that the popularity of C # is increasing sharply, while Java is relatively stable. One of the reasons is that. net allows many programming languages, unlike Java, which limits people to use only one language. Developers can write code in almost any language, including C, C ++, C #, and even Java, then translate the code into the CLR code that the machine can understand (the Common Language Runtime code ). In this way,. net allows developers to protect their "code Investment". In other words, code written in C and C ++ in the past can be reused. Java can only re-write the code.

All instructors (schools, training institutions, people with you) hope that new students can lay a good foundation for programming within enough time. From Pascal's introduction, it seems that it is very suitable from the beginning. However, I started from C and did not learn Pascal. the habits and features of programming are no worse than those of Pascal. I think this is not because of the similarities and differences between languages. It is because I took a language book and how new students learned programming. Many new students may think that it is okay to have a good class, listen to the teacher's lecture, and then come back to their computer and try the course on the computer. It is estimated that many teachers think the same way. I believe that even if some students do it, the effect is not good. For example, in C language, I have read a lot of books in C tutorials. The content is similar. The previous chapters detail the basic types of language definitions. Then I will talk about struct or something. C ++ is about class and inheritance. I don't think there is anything to talk about in class. I can say at most half a class. If someone has a certain programming Foundation, these things will learn faster. However, my experience is that these courses are full for one semester, and there are some chapters that cannot be discussed later. I am not lucky. When I was in Java, I had no hands-on courses. I had been in the previous basic classes for half a semester. Many students had not installed their own sdks, So they finally passed the test. Even this kind of hands-on course should be solved according to the traditional examination method: exam. Students who can pass the college entrance examination, whether real or false, believe that they are already candidates for the examination. For the computer system, I believe that they cannot be fully set up according to the traditional teaching mode, this is just talking with your eyes closed. The program is very unique. You can do it. A better answer is just blow. I believe that not only my school, but also other major universities will not suffer much.

Here, by the way, I think that for new students, they should be able to see the different environments in computer science and middle school. Secondary schools can take special exams without having to learn something that is too practical (unless you do not read it and prepare for work ). However, if you are only dealing with teaching at the undergraduate level, and then trying to get a scholarship, and finally you are not going to take a postgraduate entrance exam or can't take a postgraduate entrance exam, you can say that when you look for a job in the last year, you will be confused first. Although the external society does not have high requirements for undergraduate courses, it does not have to be as high as the external technical talents. However, this does not mean that students have no skills. At present, I am afraid only state-owned enterprises are very concerned with student achievement and scholarship. However, it is not expected that all the students can go to the state-owned enterprises smoothly.

Programming Language selection is also an important part, which depends on the interests of new students. For example, if hackers like it, it may be suitable for learning C and various scripts. Some people only like network programming, so maybe they prefer Java or C. If someone wants to become a good windows programming, VC ++ and. Net programming may be a good choice. There are not many languages, but excellent languages. If you only want to change the language after learning a little bit, it is better not to learn it. It is better to play games and chat with someone.

Data Structure: This is the most basic programming course. It can be said that one reason for learning programming well is that you have not learned the data structure well. Note: If you do not learn the data structure, it may not be difficult to compile it. If the student only listens to the structure of each class. If you understand the data structure, you will not be able to learn it well. Don't be happy if you get a score of 9X. It may be worse than 60 points. According to the author's experience. Many people in the same class may not understand how to implement a linked list in languages after one semester. It doesn't matter what languages are used for data structures. As long as you use a language.

Learning programming is very important, that is, learning to read others' code. Understand others' intentions from the code. In this way, you can quickly learn various skills and improve your programming skills.

Many new students may encounter a common problem, that is, they forget what they have previously compiled and will write the same functional code later. I used. I think you should understand how to save or encapsulate your written code. It can be used directly for later use without rewriting. If you think of a better algorithm later, replace the old code. Here, I suggest you learn how to create a link interface. dll or lik is used in Windows. I have not tried it in other systems. It is not clear, but there will always be corresponding link port files. In this way, after the code test is completed, it can be encapsulated into the dll and saved for a long time. It can be called when needed. In this way, we can focus most of our attention on new issues rather than on implemented algorithms.

The main point of learning programming is to do more programming. And try to solve different problems. In this way, the technology can be greatly improved. The education of an undergraduate school cannot teach a programmer. Programmers can exercise this process only by programming, re-programming, and then programming.

At last, I did not answer the question in the title. Unfortunately, I cannot give you a clear answer because of my own advantages. My point is that you choose a language that you think has a development based on your interests, and then leave it behind closed doors. It is the final principle to learn how to say it outside the render manager. You don't have to worry about turning it into another language in the future. For students, I suggest C/C ++ as the foundation for getting started. The focus can be on C ++ to learn the object-oriented thinking. From programming, we can see why we should use object-oriented rather than simply endorse it. The computer science class should not be carried back. If you do not understand it, you just need to check the information. When students have certain programming skills, they can select you as the main language. That is, you can continue to study C ++, or select any language in Java or. net. If you don't waste too much time, university time is enough to create a computer student with a good technical foundation.

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.