CppCon 2015: Bjarne Stroustrup “Writing Good C++14”

preview_player
Показать описание
--
--
How do we use C++14 to make our code better, rather than just different? How do we do so on a grand scale, rather than just for exceptional programmers? We need guidelines to help us progress from older styles, such as “C with Classes”, C, “pure OO”, etc. We need articulated rules to save us from each having to discover them for ourselves. Ideally, they should be machine-checkable, yet adjustable to serve specific needs.

In this talk, I describe a style of guidelines that can be deployed to help most C++ programmers. There could not be a single complete set of rules for everybody, but we are developing a set of rules for most C++ use. This core can be augmented with rules for specific application domains such as embedded systems and systems with stringent security requirements. The rules are prescriptive rather than merely sets of prohibitions, and about much more than code layout. I describe what the rules currently cover (e.g., interfaces, functions, resource management, and pointers). I describe tools and a few simple classes that can be used to support the guidelines.

The core guidelines and a guideline support library reference implementation will be open source projects freely available on all major platforms (initially, GCC, Clang, and Microsoft).
--

*-----*
*-----*
Рекомендации по теме
Комментарии
Автор

Thank you sir Dennis Ritchie.
Thank you sir Bjarne Stroustrup.
You totally changed history of mankind.

thesanctuary
Автор

"- Doctor, doctor, it hurts when I hit myself in the head with the hammer!
- So don't do it!"
Thank you, Bjarne! :-))

JCStelu
Автор

Prof. Bjarne is a great motivator for me. ❤

MaximBordyug.
Автор

Here in 2023 didn't think this 2014 c++ talk was worth my time... but then gave it a random shot... either this guy has charisma +7 or this is amazing.. or both? His book being delivered tomorrow... excited...

VoidloniXaarii
Автор

Although all the restrions of C++, Bjarne and others always came with new ideas that respect the principles from the day one.
Wonderful talk! C++ keeps going to be a better language for those who take programming as professionals...

NikolasDanielEngels
Автор

Awesome video by Bjarne as always.. Thanks for sharing...

maxxmayhem
Автор

I feel like Rust and C++ are trying to do the same thing, starting from opposite directions. Rust started out safe, C++ started out expressive and both languages tries to move towards being both expressive and safe. They both have their use cases. C++ integrates well with legacy code, is already well established and has much library support. Rust is still getting there, but it has come very far since this talk took place and I think it's now ready to be adopted for new projects.

Great talk, by the way!

TheLappin
Автор

I like his mention at 11:20 for not allocating memory "malloc()" "new()" in reference to C/C++' use in flight critical systems. You want to do your non-deterministic memory allocations upfront or outside of deterministic real-time time-critical code sections.

LydellAaron
Автор

"competing with C++ over the years has not been a winning strategy."

enhex
Автор

Again absolutely right SS. The avoidance of using new keywords and overloading the others etc. also makes it more difficult for compiler writers / static analysis tool developers - to develop and extend those tools as well.

MikeDiack
Автор

1:14:00, I did this exact thing as it was a huge problem where half the codebase was const correct and half wasn't. After explaining to my boss why propagate_const is needed to deal with it he said const correctness didn't really matter as you can get around it with mutable. About the same time that I quit.

cgazzz
Автор

You just don't need most of that old style code for most tasks. And it's prone to human error. Give the compiler the intent you have and let it protect you from human error as much as possible. The old dark corners of C++ are so rarely needed. This is a such a powerful language and also a very stigmatized one because of that sort of thinking. Of course the old stuff will never go away, but let's be honest about how useful it is. Easy to learn, hard to master. That is a versatile language.

aeluned
Автор

Amazing truths! I wish more young graduates thought this way.

lodathi
Автор

mr. Stroustrup said many right things.
There's only one problem I see with them.
C++ is a language of "unsound defaults". So making your code "sound" will require tons of work.
In C++, the price to make an error is almost zero, but to fix it isn't.

MrTargetSan
Автор

c++ is awesome this guy must take nobel prize of computer science

annaoaulinovna
Автор

Very good talk. I am really torn between Rust and Modern C++...
C++ has evolved very nicely but sadly, where I work people are afraid of using a newer compiler and newer features(actually, not afraid, lazy to learn new stuff is more accurate). We are still using GCC 4.4... Can't even use sanitizers, what to say of C++11, 14 and 17...

aliancemd
Автор

34:32 I accidentally did this and it has NOT been caught be the compiler, neither MSVC nor GCC.

Littlefighter
Автор

I wonder what I would have done without CppCon. Keep up the good work!

prafulsrivastava
Автор

Excellent presentation Mr. Stroustrup, I enjoyed.

baltazarus
Автор

I love bjarnes random book covers(e.g. Mountains or birds for c++ books-its funny) and love that he choose a wind power plant as beginning slide for this presentation :

fritzschnitzmueller
join shbcf.ru