CSDN editor's note: is powerful, flexible and complex: the origin of C++ can be traced back 40 years ago, and it is still one of the most widely used programming languages today. Why can C++ last forever? TechRepublic conducted an interview with Bjarne Stroustrup, the father of C++, to learn about C++ in his eyes.
source: Wikipedia
finishing | Owen Hughes
translator | Xiyan
produced | CSDN (ID: CSDNnews)
C ++ origin can be traced back to 1979, when Bjarne Stroustrup started to develop this language, it was also called As "C with Classes". The original intention of this programming language is to improve the C programming language and add some functions based on object-oriented programming.
C++ will succeed. I am also surprised that
Stroustrup said: "The success of C++ is surprising. I think the reason for the success of C++ lies in its original design goal-efficient use of hardware, coupled with powerful Abstract mechanisms and careful adjustments based on feedback from actual usage.”
Now, this language is one of the most popular languages for developers, providing support for systems and services worldwide.
"I want to create a multi-computer system with a communication system that can share memory, or a network," Stroustrup explained.
"I focus on software. I need to write low-level, hardware-like code, such as memory manager, process scheduler, and device driver, to separate software components so that they can communicate clearly on independent computers. Run on.”
However, no language was capable of this job at the time, so Stroustrup decided to create it himself. He described this ideal language like this: "C with Classes should have the ability of C language to be close to hardware, and have the ability to abstract and code organization similar to Simula."
From a very early time, Stroustrup realized that he was right. This language has no dictatorship control. Only he and a few colleagues from Bell Labs were engaged in early C++ work. It was not until the language standardization started that the number surged to dozens.
Today, the C++ Standards Committee has about 400 members and has developed a wider user group. They are followers of the language and at the same time trying to influence its development direction.
So, everyone is so passionate about C++, how do you maintain the continuity of this programming language? "This is an opportunity and a huge problem," Stroustrup admits.
"The most difficult thing is to find the key points and maintain continuity. Once you know what you want, you will eventually find a good technical way to do it."
Remember Vasa
1998 is C + +The year of formal standardization also established its position. So far, C++ has become one of the most commonly used programming languages in the world, and it remains today.
However, Stroustrup believes that it was not until the arrival of C++11 thirteen years later that it laid the foundation for the future development of this language. He said: "C++11 makes C++ feel like a new language."
"Support for concurrent type safety is essential. C++11 provides a series of mutually supporting features, such as Compile-time calculations, lambdas, automatic type inference, and variadic template [constant expression] functions.”
Although C++11 introduces some new features and functions that make the language simpler, faster, and more expressive, But it did not change the fact that this language is difficult to learn. Stroustrup also admits this.
"C++ is really complicated, and it takes a lot of effort to master it well," Stroustrup said. "Unfortunately, people don't just want simplicity, they also want something impossible: a simpler language, with more features, but without breaking existing code."
StRoustrup's response to this "dilemma" is that C++ adds some features that "make simple things easier", for example, not only supporting common use cases, while maintaining compatibility and stability.
For a "behemoth" like C++ or any other major programming language, doing this is easier said than done. Stroustrup explained that one of the biggest challenges is to reach a consensus on deciding which new features to adopt or ignore, which itself requires a lot of discussion, time and patience.
Even so, not all good features can be used. He explained: "We have to make a choice, add those features that are really helpful to people, and not too much. If all useful features are added, the language will sink because of its weight."
is like Vasa. This is a large Swedish battleship from the 17th century. Due to its poor design, the ship sank in the Stockholm port on its first voyage.
"At the insistence of the top manager, the king, the more professional judgment of the technicians was not adopted. It was full of beautiful statues and heavy guns. Because it was overweight, it was overturned by a gust of wind. Z3z
" I talked and wrote repeatedly A lot of content about Vasa, to remind and warn those who are keen to improve C++ by adding features, please remember Vasa! So so far, C++ has not crashed. "Z3z
, in Stroustrup's view, what is the survival of C++ over the years?" Start small, clarify basic principles, clarify long-term goals, and improve based on feedback from actual usage. "Z3z
Indeed, C++ has been born for more than 35 years. Today's C++ is more powerful and expressive than the earlier C++. However, to this day, the traces of the original design still remain. Z3z
Stroustrup said:" Today, some simple programs from 40 years ago are still running. "Z3z
" is an important language function for a system that has been used for decades. In fact, many of the early ideas are only available in C++20. From the beginning, I knew that there was no way to create an ideal language, so I had to aim for gradual development. To be honest, I don’t believe in the idea of a perfect language. How is it perfect? For whom?
He added: "Improvement is a necessary condition for coping with the challenges brought about by world changes and absorbing new ideas." Z3z
C++ in practice
As of September 2020, C++ is second only to C++ globally. C, Java and Python are the fourth most popular programming language. According to the latest TIOBE index, it is also the fastest growing programming language. C++ is a general programming language, favored by developers due to its powerful functions and flexibility, which makes it an operating system, web browser, search engine (including Google), games, business applications, etc. Ideal choice.
Stroustrup concludes: “If you have a problem and need to use hardware efficiently and deal with high complexity, then C++ is obviously a good choice. If you don’t have these two requirements, use a low-level but efficient language, or It can be done with a high-level but not efficient language."
However, although C++ is so popular, Stroustrup pointed out that it is difficult to pinpoint the exact purpose and use of C++.
said: "The answer to these two questions is estimated to be'ubiquitous'."
"In any large-scale system, you usually see C++ in the lower level and the performance-critical parts. These parts of the system are invisible to the general end user or even the developers of other parts of the system. Therefore, sometimes I regard C++ as the invisible foundation of everything.”
He also emphasized development People surveys are actually not that reliable in assessing the popularity of programming languages: “It’s hard to count the number of programmers. Web surveys usually just count some “noise”; in other words, the statistics are what everyone is talking about, and Not actually used."
The future of C++
Now, Stroustrup is a technical researcher at Morgan Stanley. In this financial giant, andThe cooperation between the International Organization for Standardization (ISO) of the C++ standard and the "C++ Core Guidelines" is part of his work, but he is still heavily involved in the development of C++. The most notable thing about
is that Stroustrup also organized a part of the programming language direction steering group, this group will put forward and discuss the future development of programming language recommendations. He is also a member of the improvement team and participates in discussions about new language features.
However, in the daily operation of C++, Stroustrup is more willing to play a behind-the-scenes role. He admitted: "I will participate in management work, but try to do as little as possible. I am not a good manager." Before the outbreak of the new crown, Stroustrup would spend a lot of time spreading knowledge around and through his books, articles and interviews. C++ is introduced to the world. But due to the new crown, this kind of life is temporarily over.
"In order to work better, I really need to communicate with people to understand the problems encountered by everyone, and try to use my methods to help them," Stroustrup said.
"Because of the new crown epidemic, I cannot get the feedback I urgently need. After all, online communication is different from reality. When discussing design and ideas, Zoom meetings are not as effective as face-to-face." The
COVID-19 outbreak also hinders C++ The next two iterations of the language-C++ 20 and C ++ 23 development, but Stroustrup confirmed that "almost all" C++ 20 will be released in 2020.
"In addition, there are work on Unicode, numbers, game development and low latency, tools, AI, etc. that need to be done." He added.
"When the time is right, we will launch a feature (language and library), and publish a revised standard every three years. C++14, C++17 and C++20 will be delivered on time. It is worth noting that C ++'s standard-setting work is basically synchronized with the progress of the main system.
"It is very important for C++ to maintain continuity and serve as a stable development platform. "Z3z
This article is a CSDN translation article, please indicate the source for reprinting.
https://www.techrepublic.com/article/c-programming-language-how-it-became-the-invisible-foundation-for-everything-and- whats-next/