Why study and use C language?

Source: Internet
Author: User

  First, preface

For students of science and engineering, the answer may be simple, because it is a required subject. For programmers to choose a programming language, to a certain extent, the development of career will have a significant impact, so must be cautious. So why choose a language that has been born for nearly half a century? This article is not a cliché of nonsense, such as: "C language is the basis of programming", "learn C language, all over the world are not afraid of" and so on, this article strives for detailed and rational answer to this question, aims to become the best why to learn and use C article.

  Second, C language

  C Language Dennis Ritchie , a researcher at the US-T Bell Laboratory, was originally developed as a language for the development of UNIX operating systems, with the advent of Unix operating systems, and then, with the development of microcomputers, C opened has been ported to other operating system platforms, becoming an independent programming language.

From the TIOBE programming language leaderboard, C has been a leader in the past 30 years and 90% of the time, and has only occasionally been overtaken by Java:

So is it because a language is always the first place in the leaderboard to learn and use? Obviously not, conformity is the programmer's taboo. The label for the operating system is doomed C can not mediocre, honest, C is a difficult to learn and use of programming language, no compilation principle , operating system and computer architecture Solid basic knowledge, it is impossible to C learn the understanding, With a handy. C as a very practical language, providing the operating system and memory precision control, high-performance runtime environment, source-level cross-platform compilation and other advantages, we must learn and use C reasons.

at the same time, fortunately C is also an interesting thing, the deeper the cognition of programming, the more interesting, I simply enumerate Some of the advantages of C:

2.1) structured design language with clear syntax, simple structure, Modularity makes each part of the program independent from each other in addition to the necessary information exchange for easy development, commissioning and commissioning.

2.3) rich in data structures that enable the operation of a variety of complex types, introducing pointers, The structure concept makes the program more efficient.
2.4) is an operating system that can operate on bits, bytes, and addresses like assembly language. Allows direct access to the physical address of the hardware to operate, the basic structure of the high-level language and statements and the practicality of low-level language combined.
2.5) program execution efficiency is generally less efficient than assembler-generated target code 10%~20%.
2.6) Good portability, C-language abstracts the details for CPU programming, Can be widely used for large-scale operating system and system software writing.
2.7) with powerful drawing capabilities, as well as C + + can write very elegant two-dimensional, Three-dimensional graphics and animations.

Some people say that C is a subset of C + +, C can do things, like C + + can do, and can do better, such as: three major object-oriented features, GUI programming, admittedly, I admit that in the field of GUI programming C + + occupies an absolute dominant position, so far no one can shake. But is it really necessary to use C + + instead of C to get the job done? A lot of times C + + solves the problem the idea really is more advanced than C?

  

  Iii. Comparison of C and C + +

Write to this paragraph when I have a trembling, thin ice feeling, after all, C, C + + is the vast number of programmers are very familiar with things, the mouth cannon is also extremely scary, in fact, in relation to the issue of faith, any controversy is endless, is meaningless. I hope that we do not use a lot of energy to argue about the pure language, but to think about how to do things right, what is the right thing to do-fast and efficient development, to ensure fast and stable operation, fast and simple maintenance.

Is the mouth cannon big god Linus Torvalds attack C + + and around him the sharp words of the C + + Daniel programmers, in fact, I personally do not appreciate the Linus personal style, I still hope that we can talk calmly about C + + some advantages and status:

     3.1) implicit operation: C simple and straightforward, the structure is clear, each line of code can be clearly disassembled into the corresponding statement, the system will strictly follow your code to execute. and C + + is not necessarily, simple statement also said it is not clear how many times the construction and copy, so writing the underlying code is completely not, the bottom of the need for precise and strict control.

3.2) Language interface: the development of modern software engineering projects, not only the performance has a high demand for language interface docking ability also has a high demand, because a huge project is rarely used only one language to develop, for the bottom, C + + memory and hardware control less than C concise precision For many dynamic languages and middleware, such as: PHP, Python and Apache,Redis, have been greatly influenced by C, even the C developed by the things, docking is very convenient. Yes, in fact, C + + uses circuitous way can also docking, but, far less than C convenience, development and maintenance costs are very high. 3.3) hardware layer:3.2.1>allocate Memory: After the system is power-up, the assembly initializes the stack, and then jumps to the C language Start_init () function, when the memory allocation mechanism has not been established, how C + + defines the class? How do I instantiate an object?       3.2.2>Standard library Dependency: All features of C can be run independent of any library, and if necessary, you can write your own library according to your specific requirements. 3.2.3> Processor compatible: C + + class is based on base address + offset address addressing method, many microprocessors only a simple given address addressing, does not support a statement to implement base + offset addressing mechanism, many C + + code compiled out need more instructions to calculate the address, Cause performance degradation too much. 3.4) Application layer: C + + in the application layer, especially GUI programming, which is the traditional strengths of C + +, I have always insisted that C can also gracefully make images and animations, but the development efficiency is really much lower than C + +, recently there is a very fire of RUST language, number said that the only alternative to the future of C + + programming language, interested students can pay more attention. Iv. Summary  below I have listed more than 10 current hot development direction, a rough introduction of the following projects in the most commonly used programming language:    from the know, operating system, compiling principle, data structure and algorithm and so on the basic knowledge, is in-depth understanding, mastering and flexible use of the important premise of C, the current programmer career more than half of the hot direction directly or indirectly with C, I think, learn the importance of C is self-evident.  

Why study and use 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.