CPPCON2020 Session Review: Back to Basics: Class Layout

There are two types of knowledge: timely and timeless.

Knowing how your types are laid out onto physical hardware is programmer’s gold and it is timeless knowledge. It never leaves you. I would recommend strongly this talk if you work closer to the metal, or if you work with code bases that make use of object-oriented programming–and before you say that OOP is dead, consider digging (and I mean digging) into RocksDB, TensorFlow, and so many other successful open-source pieces of code where you’ll see how layout is important and the amount of OOP code in them.

I enjoyed this refresher on class layout by Stephen Dewhurst, and was pleased to see the use of no_unique_address attribute and the has_unique_object_representations type trait mentioned in the talk (and of course, you can find them in Spanish, no_unique_address and has_unique_object_representations)

But then again, I’m biased. I took a class with Stephen back in 2003 (and the other instructors were Dan Saks, Scott Meyers, Andrei Alexandrescu and Herb Sutter). Stephen has had a lot to do with the success of C++, but in particular, by being an educator and an evangelist.

I used to own his book Programming in C++, and still own C++ Common Knowledge, which I consult when relevant.

Last year, in CPPCON2019, I had a chance to talk to him and catch up. If you see him in a future CPPCON hanging out in the halls after a class or session, stop and say hi. He’s still the same easy going guy.

This entry was posted in C++, C++17, C++20, programming languages, software and tagged , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s