📜 ⬆️ ⬇️

30 years of C ++

On October 14 of this year, one of the most important anniversaries of the programming world took place - the 30th anniversary of the C ++ language. During this time, it gained immense popularity and still remains one of the most popular and widely used programming languages ​​in the world.

In connection with this jubilee, we offer you a translation of an interview with the founder of the language, Bjorn Stroustrup.



Exactly 30 years ago, CFront 1.0 was released and the first edition of the book “C ++ Programming Language” was released. Was it important to release them on the same day?
')
I don't know if this was important, but at the same time it was a good idea. I was asked by AT & T (the company selling the compiler) and Addison-Wesley (the publisher of the book) about which day would be successful for the release. I called on October 14 because I was supposed to speak at a conference of the Association for Computer Technology of the USA and could present it there.

This made you twice a writer and may have required twice as much work. But did writing a book help develop a better language?

It was a necessary book. A tiny but ever-growing community needed it. The idea to write this book did not even enter my head. This idea was given to me by Al Aho, later my neighbor at Bell Labs (Bell Labs is a company like AT & T). I absolutely underestimated the amount of work on the C ++ Programming Language. Writing on a completely new topic is very difficult. I learned a lot about language, trying to explain it to people. I changed C ++, and the explanation became simpler due to the fact that the language itself became more logical or more functional. Writing instructions is a very good way to design.



Do you remember how you felt on Monday, October 14, 1985, when you presented your seminar “Introduction to C ++”?

No, I do not remember. In fact, from what happened in the 1980s, I remember relatively little. I was very busy then. Between 1979 and 1991, the number of programmers using C ++ doubled every 7.5 months. Such growth generates a very large amount of work. Today, the number of C ++ users reaches 4.4 million (according to a JetBrains study). It was an important day for me, but the only thing I remember is how I got my first copy of my first edition.

How did you see C ++? What did his future represent?

Of course, I did not expect such an incredible, sometimes explosive growth of the language. I concentrated on improving it, studied the writing of libraries, improved the compiler, and explained how to use it all.

On the other hand, much of what we see in C ++ today is rooted in those days. Classes, function declarations (function prototypes), constructors, and destructors were part of the very first version. A couple of years later, I added inline functions and an overloaded assignment operator. Then there was a difference between initialization and assignment. The general operator overload arose later (1983 or so), at the same time as virtual functions. People often forget that parameterized data types were implemented from the very beginning. I used Cfront with the header <generic.h>. For a couple of years, I thought that for generic macro programming would be enough. I was very mistaken, but I was right in believing that it was necessary to use parameterized types and functions with (other) types. The result of this was patterns (1988).

The main idea was to enrich the language with features that allow users to cost powerful, beautiful and effective abstractions. This is contrary to the idea of ​​supporting application-specific abstractions in the language itself. C ++ still uses the basic computer model from the C language, which allows you to create portable programs that efficiently and efficiently use hardware. We are also working on a gradual improvement in C ++ to support the construction of efficient abstractions.

Most attempts to develop a good programming language fail. How did it feel to have more and more programs around you written in the language you created? And what do you think was the reason for such success?

Joyfully - and at the same time scary. It's nice to feel that you have developed something useful for so many people, but it is also a huge responsibility, especially with the development of the language. If we added successful and useful features - we made this world a better place, but it was worth making a mistake - and the harm would be very great. And yet I think that the refinement of C ++ was a series of improvements. Not all ideas were successful, but most proved very useful to most, and failures were not fatal. Every year C ++ is getting better. Now C ++ is incomparably more useful than the release 1.0 released in 1980. We can write more beautiful code and it works faster (even if we take into account the difference in the speed of the equipment).

Reason for success? There were a lot of them. To succeed, the language must be good enough in all that users need, and at the same time should not be a failure in anything. It is not enough to be the best in the world in one or two things. Basically, C ++ has been and remains focused on critical tasks in systems where performance and access to equipment are critical (so-called system programming), and especially systems where complexity management is necessary. Secondly, C ++ constantly evolved in accordance with the problems of the surrounding world, it grew. It has never been an ivory tower. In the end, it seems to me important that C ++ never lived on advertising: I made relatively modest promises and kept them.

You have dedicated C ++ for the most part of your life, and you continue to actively work on it to this day. What caused such dedication? Would you like to start working on a new programming language?

I have repeatedly tried to get out of the development of C ++, but he always pulled me back. I feel that working on C ++ is my main chance to make something worthwhile. Thus, C ++ is my main research and development tool. The lessons learned by me and other members of the C ++ community are being introduced into the language and libraries, where they can help millions of people already.

Of course, I dreamed of creating a new, more advanced programming language, but it takes a very long time to go from a set of ideas to a useful tool. It is difficult to compete with C ++ on its field, and most of my interests are what C ++ is good at. In addition, most new languages ​​fail. It's very easy to make a mistake by developing something from scratch. Successful large systems tend to grow from smaller operating systems.

What has changed in 30 years? What remains the same?

Model cars and the desire for greater support of abstractions remain unchanged and as important as ever. The same can be said about the attention paid to the static (compile-time) data type system.

The use of exceptions and templates has been greatly improved, and now we can write much more beautiful and functional code. Both appeared as possible directions for the development of C ++ in a document that I wrote for IEEE Software magazine in 1996. Exceptions together with designers and destructors became the basis for secure resource management (RAII). The templates contributed to the successful development of the STL library of Alex Stepanov and his ideas of generalized programming. Literally this year, we developed direct language support for concepts to complement the capabilities of C ++ templates.



In the late 1980s, people were obsessed with using class hierarchies. I was more interested in combining various programming styles into a harmonious whole. In the first edition of my book, I (intentionally) did not use the term "object-oriented programming," and also gave performances with titles in the spirit of "C ++ is not just an object-oriented programming language." Later, the public showed great interest in template and meta-programming, sometimes forgetting that the simplest solution is often the best. I am still looking for a way to convey my understanding of elegant programming, based on a synthesis of language features and library features.

Another thing that, in my opinion, will be of great importance over the next few years is the development of guidelines for tools and libraries. This will help the C ++ community to learn new features much faster. One completely new aspect is that we can eliminate the trailing pointers, opening up possibilities for programming that is absolutely safe in terms of types and resource management. In particular, we fix all resource leaks without a garbage collector (because we don’t produce garbage), so we don’t have to face performance losses, although security is increasing. And we do not limit the scope of C ++ .

I hope that all this will help solve the problem that existed in C ++ always: lack of training and understanding of C ++, even among the people who use it. From the very beginning, there was a tendency to describe C ++ as a strange version of something else. For example, it is still sometimes said that C ++ is "a few new features added to C" or "unsafe Java, which lacks some modern features." This is doing great damage to C ++ distribution. My new book, C ++ Overview , can also help. I tell everything about C ++ and its standard library at a fairly high level, with fewer pages than in Brian Kernigan and Dennis Ritchie's C Programming Language (also known as K & R). My book is intended more for already accomplished programmers than for beginners.

In a few days, the C ++ committee will meet in the Hawaiian islands to discuss work on the next major version of C ++. What do you think C ++ 17 will look like?

I think a more complete picture of what C ++ 17 will look like will come to me after the meeting, which will be held next week in Kona [Hawaiian Islands]. But I am (calmly) and optimistic. C ++ 11 was a great achievement compared to C ++ 98, and I hope that C ++ 17 will be an equally big step forward compared to C ++ 11.

For example, I hope to see:

Translation: http://blog.noveogroup.ru/post/132140074527/
Original: http://cpp-lang.io/30-years-of-cpp-bjarne-stroustrup/

Source: https://habr.com/ru/post/270083/


All Articles