Presentation Slides, PDFs, Source Code and other presenter materials are available at: https://github.com/CppCon/CppCon2017
—
No offense to Shakespeare, but in C++ there is a lot in a type name. A name represents a set of data and behaviors, and changing names is an often difficult and painful process. This could be to reconcile some repeated logic into common functionality, upgrade a hand-rolled type to a standard type (or vice-versa), or just upgrade your interfaces to be easier to use.
When these types are widely used throughout a large codebase, conventional wisdom dictates that this refactoring is difficult or impossible -- changing every instance of a widesperead type would cause widespread merge conflicts, if all instances can even be found. In C++, however, it’s possible to refactor types non-atomically, in small steps which preserve invariants, without breaking any users of your code. Library teams at Google have refactored millions of lines of code this way -- this talk will outline common strategies for non-atomic renaming and refactorings, and antipatterns such as ADL use and forward declarations which complicate the process. That is:
'Tis but thy name that’s not my namespace;
Thou art thyself, though not a standard class.
What's montague::? It is not base, nor parent,
Nor member, typedef, nor any other part
Belonging to a class. O, be some other name!
What's in a name? that which we call a ::rose
By any other name would std::move as swift;
std::romeo would, were he not ADL call'd,
Retain that dear perfection which he owes
Without that title. ::Romeo, doff thy name,
And for that name which is no part of thee
Take all myself.
—
Jon Cohen: Google, SWE
Jon Cohen is an engineer at Google, maintaining our core common C++ libraries. He spends most of his days directing Google's robot army to rewrite its own source code to be more readable and efficient, and has so far managed to do so without accidentally creating Skynet.
—
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
*-----*
Register Now For CppCon 2022: https://cppcon.org/registration/
*-----*
Смотрите видео CppCon 2017: Jon Cohen “A Type, by Any Other Name” онлайн, длительностью часов минут секунд в хорошем качестве, которое загружено на канал CppCon 28 Октябрь 2017. Делитесь ссылкой на видео в социальных сетях, чтобы ваши подписчики и друзья так же посмотрели это видео. Данный видеоклип посмотрели 2,626 раз и оно понравилось 28 посетителям.