Empirically Measuring, & Reducing, C++’s Accidental Complexity - Herb Sutter - CppCon 2020

preview_player
Показать описание
---
We often hear “C++ is more complex than it needs to be,” typically demonstrated using anecdotes and “gotcha” examples. Those can be valid and demonstrate real pain points, but it would be nice to have more quantifiable data that we could analyze to measure sources of complexity. This talk reports work to systematically catalog and measure C++’s unneeded complexity, how some current evolution proposals may address its major sources, and presents specific suggestions on what we might be able to do about it in the context of a future-evolution proposal to simplify parameter passing and provide meaningful initialization guarantees in C++.

---
Herb is the chair of the ISO C++ standards committee, a programming language architect at Microsoft, and the author of over 200 articles and 4 books about C++ and related topics.

---

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

Herb Sutter is a very concise and frank speaker, truly a gifted presenter and teacher. Disregarding whether we agree on his approach, how he presents his perspective makes a debate simple and automatic and that’s the true gift he possesses. No snark, no irony, all substance.

gldsun
Автор

This would make me like C++ so much more. So simple, yet so effective. This HAS to happen.

WouterStudioHD
Автор

Lots of great talks in CppCon20 this year. But this is the best in my opinion. Can we rush this feature to C++23 🙏

chefnyc
Автор

Love this! We need a lot more simplification in C++. Spec is getting insane! 25+ years of C++ but I also do a lot of other languages and it's always easier....and as others echo it's complicated for no apparent reason - not for performance. I'm not leaving C++ but c'mon. This in/out/etc feature would also reduce the amount of annoying constructors, assignment operators and other boileplate code just to write a single class too.

ColinMacKenzieRobots
Автор

Herb's proposals giving C++ a way to stay vibrant in the 21st century

TheSulross
Автор

This is great. I feel like by the time I'm retired C++ is going to be a really nice language.

zxxvcc
Автор

It's just a pure beauty of design. When I get something close to it in mainstream, I will have tears came to me.

mapron
Автор

Love this proposal and the empirical method used to study accidental complexity in c++. Thank you Herb.

satyeva
Автор

The last slide on efficient abstraction was the best one of the talk. It perfectly encapsulates the best way to proceed: Figure out how to do things by hsnd, gain valuable experience in what works well, what doesn't. Then automate.

brymusic
Автор

While it's a huge improvement over the current conceptual mess of a simple basic task of passing parameters, it's hard not to note that other languages somehow manage to get away with just in, out, and inout parameters...users of those languages can't think of the "move" and "forward" in their worst dreams.

DmitryShaporenkov
Автор

This is really great, nice to know C++ is moving forward to keep it simpler and powerful!!
Great thanks!

RicardoCapurro
Автор

This talk makes so much more sense with cpp2 in mind :)

krumbergify
Автор

This would be so pleasant! One request: for explicit uninitialized please use 'uninit' as the keyword (I feel I may be typing it a lot).

egparker
Автор

That's the best proposal about syntax changes I've seen before.
SFINAE + PF (whatever via "requires" or using old syntax) is just pain to make dispatching of methods to be invoked depending on passed type.

MrDddd
Автор

wow this is really awesome. i hope this all gets implemented

Quazgaa
Автор

I like this idea. I hope it can be picked up and added to C++ 23.

MasterOfMisc
Автор

Please God Herb, can you save C++ from the swamp of complexity it is in and which grows with every new standard release.
Even the creator of C++, Bjarne, says it is ten times more complex than it need be. As you say.
Can we have a compiler switch that errors out on the 90% of things we should not be doing?
I know, there is a lot of junk in the language/library that is still there for backwards compatibility and is no longer the recommended thing to do.
But if I want to write new code, and learn the "new" C++ the compiler should point out when I'm using those old deprecated ways.

heater
Автор

I really hope I get to use this in my code soon. This is awesome.

quinndirks
Автор

I wonder if one could even get rid of "move" and "forward" and let the compiler figure out whether "in" can be promoted to them. If needed, allow the compiler to generate multiple versions of the function for that purpose, i.e., allow every function to be promoted to template form.

markmaker
Автор

Never mind the specific proposal here, I think there is a lot of merit in the idea of evolving C++ to the point that we can subset it to "C++ pure", particularly if the conversion of existing code to the subset can be semi-automated. This approach would mean keeping lots of existing tooling and knowledge, instead of throwing everything away and starting from scratch. In my world, that is much more likely to happen that starting everything again in Rust.

nintendoeats