📜 ⬆️ ⬇️

Why Vase drowned, and C ++ still afloat

This article is a brief retelling of the incredibly interesting report by Scott Myers for those who do not have 70 minutes for the entire report, but have 7 minutes for the main theses.

Some people who do not write in C ++, but have only heard about this language, ask the question: “Why does anyone write in C ++ at all?”. But there are people who use C ++ every day, and these people ask themselves: "But really, why do I write in this language?".

But really, there must be some reason why people write programs in C ++. Let's go back to the beginning of the 90s when C ++ standardization was taking place. A lot of ideas were proposed. There were so many offers and they were so different that I remember the quote of Jim Waldo, who then worked in the standardization committee: “Everyone who proposes to add something in C ++ must attach his kidney to the application. Then no one will offer more than two ideas, and the choice of these two, he will fit incredibly responsibly. "
')
The language that would have been received as a result of accepting all the proposals came out too complicated, and then Bjarne Stroustrup said “Do you remember Vaz?”. No one except people from Sweden understood what they were talking about. The vase was a huge warship built in Sweden in 1625. The basic principle of the construction of the ship was "Why do not we add here also this feature?". Many of the ideas came directly from the king, in particular, he personally claimed the size of the ship. Also, on the VAZ, on instructions from above, it was necessary to fasten a huge number of decoration elements, carvings, a large number of guns, etc. And you can't refuse the king. The result was logical - due to errors in the design of the vase sank in the first voyage, barely out of the bay.

Let's look at C ++. Is it just as loaded with features? At first glance - no doubt:



Let's take a look at this:
f(x);


— f, . ? . , , . , . , - . . . .

, ++ . , . .
. . , , , .. , 25 ++ 2-4 .



++ opensource (12%) .



, - . - . .


— ++. , IDE, , — ++ . , « ++, , STL — ++». 90- 2000-. — .


? ( : « », «»). . . RAII. . , , . , goto.


, , , - . . , , , — . - , .
++ , , , - . . !


, , . . ++11, .


++ , , . , — . , ++ , .


? . - ? . ? . « » ? . ? . - ++.

« »

, ++ , , « ». , , , .. ++ ( ) — - , .

,

. , — . — . , , , . . .

«- »

. ++ . ++. — . , /++ .


++, 90- ++ , ++14. . , . , . , . , , . : ++ — 10 20 , .

,

++ , — . , ++ ( ) . ++ . :

std::cout << x;


! , , ( ), ( ) . ! . , ? , , ? . , .

,

, ++, . — , , . , — . , — , , . ++. , , . , , , ++ ++ — . - .

,

, ++ . . . -, - -. , . .

…

, ++ 1990- 400 , 1998 — 700, 2011 1300. « » — . , . , , , . , — ++11 range-based for auto. , 5. - — , . , . .

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


All Articles