Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Is it hairy to learn the C language and to learn C?


May 31, 2021 Article blog


Table of contents


This article was reproduced by The Public Number: Code Sheep, by Hansonwong999

I recently received a question from a reader's little buddy, and I cut two diagrams.

 Is it hairy to learn the C language and to learn C?1

 Is it hairy to learn the C language and to learn C?2

It's true, I've seen this kind of question a lot before, but I forgot to take a screenshot.

Every time you encounter this kind of problem, it seems very simple, but typing for a moment and a half will really not be clear, think about this weekend, write an article to talk about it, if the small partners have different views, but also welcome criticism.

What is the relationship between C and C++

"First of all, the C-plus and C-languages are two different programming languages, but C-plus is really an extension and extension of the C language and provides backward compatibility for the C language." It's still a bit awkward for some people to say that the C language is completely contained in C.

When it was first invented by Bjarne Stroustrup, it was originally called “C with Classes” or C with class". I t is clear that it extends object-oriented features and mechanisms such as class classes on the basis of the C language. But then, after step-by-step revision and many evolutions (as shown in the figure below), it turned out to be what is now a vast programming language that supports a number of important features.

 Is it hairy to learn the C language and to learn C?3

As the classic book "Effective C+" begins, now we refer to C+ as a vast "language federation", which contains at least the following important components:

  • Process-oriented programming
  • Object-oriented programming
  • Generic programming
  • metaprogramming
  • Functional programming
  • STL standard library

The first part of this part, "Process-oriented programming", is the backward-compatible part of C language provided by C++ , so you can see that most of the books on the market that speak C++ programming are basically talking about "process-oriented programming" in the first few chapters, including but not limited to: data types, variables, operators, expressions, statements, judgments, loops, functions, pointers, and so on.

Can I learn C++ directly without learning C?? C

Or, as mentioned earlier, the first and most important component of the C++ programming language is "process-oriented programming", which is the domain of C Brother C. E ven if you haven't learned the C language, it should be hard to escape the "process-oriented" part of the small partner who learns C++ as soon as you come up. Because most of the books on the market that talk about C++ programming begin with "process-oriented programming."

In theory, C++ it's not necessarily a need to learn the C language before you learn C but it's often more advantageous to have a C language base to learn C++ least the part of "process-oriented programming" that's easy to learn.

Unfortunately, even the 700 authoritative C++ of "C-Primer" begins with only a small part of the "process-oriented programming", so there is certainly no detailed and comprehensive analysis of the process-oriented part of the story, otherwise there will be no emphasis on pointer-related "C and pointers" and other such books. C

So personal advice is that the foundation of the C language should be as solid as possible before learning C++ which is certainly helpful.

C Learn well, is it more advantageous to learn C++

That's right.

At the very least, when you learn C++ the "process-oriented" part of it can be said that the light car is familiar.

Can C++ C language?

Why learn C++ language when it is so powerful, contains so many modules and paradigms, and contains almost this part of C process? C All directly learn C++ isn't it fragrant?

Yes, it's true that C++ powerful, but the burden of those powerful paradigms and mechanisms themselves is not light, and it does place a considerable burden on learners, and even discourages many people.

C C on the other C is itself a programming language that balances competencies, performance, efficiency, and learning costs so extremely that the mandatory programming courses at the university level are basically C

And C language is extremely widely used, up to the operating system at the bottom of the native interface, down to the ordinary application layer development, C language has a lot of credit. So much so that for so many years, the C language has been at the top of the Tiobe programming language leaderboard.

 Is it hairy to learn the C language and to learn C?4

And in the opening year 2020 the C language returned to the top of the throne, winning the 2019 Although it's just a seemingly boring ranking, it's more or less telling.

 Is it hairy to learn the C language and to learn C?5

So whether it's the past, the present, or even the future, the nearly 50 C general will never be a slave.

Is it suitable for large projects only if the object-oriented language of C++

The emergence of C++ is indeed intended to make it easier to develop large applications, after all, many of the important ideas and mechanisms in object-oriented programming provide strong support for project engineering, code reuse/scalability/maintainability required by large projects and complex systems.

But the facts at hand tell us that even the C language can build extremely complex systems and software. Up to Linux the world's great operating system kernel, to open source software or frameworks such as Redis Nginx which companies rely heavily on, are representative of C language.

So sometimes we have to admit that what we call abstraction is more about the person who wrote the program than the programming language itself.

Small knot

Well, it's a little too much, to sum it up:

  • The C language and the C-plus are two different programming languages, except that there is some overlap in the content;
  • C language is a very powerful programming language, I think there is a chance or to learn;
  • In general, with the foundation of the C language, it is faster to get started with C.
  • There are different selection considerations and application scenarios for C and C, and no one is better off talking about learning not to look at their own interests and their own technological development considerations

Is the above W3Cschool编程狮 about learning C language and learning C plus it has a hairy relationship? Related to the introduction, I hope to help you.