C language is not simple, even programmers say so, why?

Source: Internet
Author: User
Tags apache php php mysql posix
Before the university that will learn the first language is C language, everyone should be the same as me, as long as the professional use to get the language, should have learned C Language bar, perhaps everyone agreed that C is the most basic of the simplest, of course, to learn it, the fact is not so, in fact, I know a lot of programmers God is more difficult to learn This is also true, the C language may be very simple grammar, suitable for beginners to learn, but, if it is used in development, but is particularly complex, this article will be described in detail. Apache PHP MySQL

begin!

The bottom of the = = OK?

The C language provides the underlying operations, such as pointers. but the biggest difference between C and C + + is that the C language avoids pointers, and C + + and the STL and smart pointer libraries completely shun it. That is to say, pointers to other languages are just types, and the pointer to C is a pointer. I've always thought that beginners ' early exposure to pointers is a big taboo. What beginners need is a variety of playful applications to generate instant feedback instead of delving into computer systems because the latter only kills their confidence. Beginners should focus on the logic of the code and block out all things that deal with the underlying. Do you think it would be interesting to tell you about periodic law and VSEPR models if you were just studying chemistry?

exposing the underlying layer is also harmful from another perspective, which involves manually managing memory in the heap. computers pay attention to a trade-off, and you can say that this is an efficient way to execute, but in most cases it is not right to over-pursue execution efficiency and neglect development efficiency. Manual memory Management is a high-level programmer thing, the novice programmer should be completely to the language features to manage memory, otherwise, your program three days out of a null pointer exception, five days out of a memory leak, who is the subject? So C language, no matter from which point, is not suitable to get started.

Small series to recommend a learning atmosphere is super good place, C + + ac penguin skirt: 341636727! Suitable for college students, small white, want to change careers, want to find work through this join. There is a lot of learning materials in the skirt, there is great God to solve the problem of communication, every night free live lessons

Another view is that only the C language can access stacks and heaps of models. I am responsible for telling you that all non-scripting compiled languages, such as C + + and swift, and managed languages such as C # and Java, are exposed to stacks and heap models, and because of the automatic memory management mechanism, the latter uses heaps much more frequently than C. The scripting language also has its own variable container model, such as PHP's Zval. The pot should not be memorized by the programming language, but should be backed up by domestic waste textbooks. It can also be seen that the C language stack model is not placed in the universal, if you take it to other languages, it may not work. But some people have to take it as a basis for learning other programming languages, which is ridiculous.

The Simple price

The C language does not provide advanced encapsulation and abstraction for some common components. like a hash table, you have to use the time you have to build one, or search the Internet to see if there is no ready code. This is very unfriendly to the developer. Since there is no such thing in the C standard library, it is not mentioned at all, which leads to a lot of people even do not know that there is such a thing, when encountering problems can only despair. The only container the C language supports is the native array, and the string is implemented with an array of primitive characters, so the processing of the string is very, very weak. If you want to write a string concatenation of the code, Java to a line, C language to several lines. This is the cost of the "simple" C language.

The simplicity of C is precisely the omission of OO native support in Exchange for. What I said above is the native support, because C language or can be implemented in a combination of OO, such as inheritance with the combination of implementation, virtual function with pointer function members to achieve, and so on. In Oo, C language is much more difficult to implement than C + +. C + + a keyword, corresponding to the C language is a few lines of code, how to talk about simple? Oo good or bad, it is now the common language paradigm of the industry, its role as the natural language of English, as important. If you don't touch this, you'll be at a disadvantage when looking for a job. But is oo really complicated? These things, if you go through Java books, at most two chapters introduced, one chapter is the class, chapter is the interface. Other less OO languages simply spend a chapter, telling you that there is a class, and that these pages are almost the size of the structure and enumeration in the C language tutorial.

C language "Simple" means that in real development, you need to do more manual work to replace the compiler. I think God is fair, give other languages more language features, will also give them a higher development efficiency.

Talk more about the standard library

the reason for the book of C books is not that there is no such thing as OO, but the lack of modern components in the standard library, which are all in POSIX . Leaving the POSIX API to speak C is bullying. Generic components or facilities, to the C language side, one will not be less, because the modern program operating environment and requirements, you leave these things, you can not write anything. The five major libraries of modern programming languages (string, container, IO, thread, network), the C language has two holes. As for the two behind, C language developers have to use the POSIX API, and then solve the API incompatibility problem. The C language standard library of virtue, away from POSIX is semi-residue. And if you want to understand POSIX, you have to see "Apue". If you tell me C language is simple, after reading "Apue" that a big thick book, and then tell me simple.

Not the postscript of the PostScript

we learn a programming language not to deal with exams, but to actually do things. like the C language without containers, no strings, no templates, no exceptions, no raii, all the wheels made themselves, without the modern programming language characteristics of the language, the real time complex to explode. Sorry, I have no time to study how each feature or class is implemented in C, and I prefer to express my logic in a shorter code.

End

Where do you see the simplicity of this? Is it easy to write a toy program? Anyway, I think it's so complicated, it's not like my college hours, or maybe I learned the fake C language.

Related articles:

10 C-language resources that will make you a better programmer

C Language 10 Classic Applet

Related videos:

C Language Tutorials

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.