May 31, 2021 Article blog
1. What is the relationship between C and C++
2. Can I learn C++ directly without learning C?? C
3. C Learn well, is it more advantageous to learn C++
5. Is it suitable for large projects only if the object-oriented language of C++
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.
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.
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.
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:
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.
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.
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.
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.
So whether it's the past, the present, or even the future, the nearly
50
C
general will never be a slave.
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.
Well, it's a little too much, to sum it up:
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.