The characteristics and shortcomings of C language

Source: Internet
Author: User
Tags php language mathematical functions

 The characteristics of C language can be summarized as follows:
1. C language Concise, compact, flexible。 The core content of C language is very few, only 32 keywords, 9 kinds of control statements, the program writing format is free, compressing all unnecessary ingredients.
2. concise and practical expression method。 C language has a powerful set of operators, up to 44, can construct a variety of forms of expression, an expression can be implemented in other languages may have to use multiple statements to achieve the function.
3. has a rich data type。 The more data types, the more expressive the data will be. C language has a variety of modern language data types, such as: Character type, integer, real, array, pointer, structure and common body. Various complex data structures such as linked lists, stacks, queues, and trees can be implemented. The pointer makes the parameter transfer simple and fast, saving memory.
4. features of a low-level language。 With assembly language similar to the function and description method, such as address arithmetic, binary digit operation, etc., the hardware port and other resources direct operation, can fully use computer resources. Therefore, C language is not only a high-level language to facilitate learning and mastery of the characteristics, but also has the machine language or the assembly language to the hardware operation ability. Therefore, the C language can be used as both the system description language and the General programming language.
5. is a structured language, suitable for modular design of large programs。 The C language provides basic control statements for writing structured programs, such as IF~ELSE statements, switch statements, while statements, do~while statements, and so on. C program is a collection of functions, functions are the basic unit of the C program, each function has a separate function, the function of passing data through parameters. In addition to the user-written functions, different compilation systems, operating systems are accompanied by a large number of library functions for users, such as input and output functions, mathematical functions, string processing functions, flexible use of library functions can simplify the design of the program.
6. pre-processing commands and preprocessor are available in various versions of the compilation system。 The preprocessing extends the function of C language, improves the portability of the program, and provides convenience for debugging large-scale programs.
7. Good portability。 Programs can be ported from one environment to another in a completely different environment, without modification or modification. This is because system library functions and preprocessor separate the possible machine-related factors from the source program, which makes it easy to redefine the content between different C-compiled systems.
8. high quality of target code generated。 The target code obtained by the C source program is more efficient than the one written in assembly language, but only 10% to 20% lower, which can give full play to the efficiency of the machine.
9. C Language Grammar restriction is not strict, programming freedom is big。 The C program does not perform checks such as array subscript bounds and variable type compatibility at run time, but it is up to the programmer to ensure the correctness of the program. The C language almost allows conversion of all data types, character types and integers can be used freely, all types can be logical, you can define a new type, and you can cast a type to the specified type. In fact, this allows programmers to have greater autonomy, to write a flexible, high-quality program, but also for beginners to add a certain degree of difficulty. Therefore, only after mastering the C language Program design, can realize its flexible characteristics.
Through the above introduction, we have learned some characteristics of C language. Although C language is a good computer programming language, but there are some of the following shortcomings, to understand these shortcomings, only in the actual use of weaknesses.
1. C program error is more covert。 The flexibility of the C language makes it more error-prone to write programs, and the C compiler does not check for such errors. Similar to assembly language, it is necessary for the program to run to discover these logic errors. C language will have some hidden trouble, need programmers attention, such as the comparison of "= =" as the assignment "=", there is no grammatical error, such logic error is not easy to find, it is often time-consuming to find out.
2. C programs can sometimes be difficult to understand。 C Language Grammatical composition is relatively simple, is a small language. However, its data type is many, the operator is rich and the combination is diverse, making it difficult to understand. The most commonly said word about operators and binding is "multiplication first, plus minus, and sibling operations from left to right", but C is much more complicated than this. C language, in order to reduce the character input, C is more concise, but also makes C language can write the ordinary people almost incomprehensible program.
3. C programs can sometimes be difficult to modify。 Given the size of the program or the mega-scale, modern programming languages typically provide language features such as "Class" and "package", which can break down programs into more manageable modules. However, C language lacks such characteristics, it is difficult to maintain large programs.
Early computer languages, such as BASIC, FORTRAN, ALGOL, COBOL and Pascal, have been used relatively much less recently, unless they are used by existing software systems, or when some people want to use ready-made programs or software.
Today's software development uses more of the C + + and Java languages, while developing Web applications using the JSP language and the PHP language. With the widespread popularization of object-oriented technology, the Java language is favored by many people, this is because the Java language has high programming efficiency, reduce the cost of software development, do not need to consider the storage allocation and recycling program details, written out of the program more robust, but also to a certain extent, the cost of operating efficiency. The C + + language is the object-oriented computer language, which is a high-efficiency and fast-running feature.
C language is a procedural language, and professional programmers or software developers should learn the language of the computer. This is because C language can be used in lieu of machine language or assembly language to write fast programs, for SCM applications, embedded systems and communication software is irreplaceable; C language pointer and computer hardware address have similarities, is the key to understand the essence of computing; C language-related storage allocation functions, You can learn more about the principles of computer storage allocation.

The characteristics and shortcomings of C language

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.