Loading…
This event has ended. Visit the official site or create your own event on Sched.
Back To Schedule
Wednesday, September 27 • 4:45pm - 5:45pm
A Type, by Any Other Name

Log in to save this to your schedule, view media, leave feedback and see who's attending!

Feedback form is now closed.
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. 

Speakers
avatar for Jon Cohen

Jon Cohen

Software Engineer, Google
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.


Wednesday September 27, 2017 4:45pm - 5:45pm PDT
Manchester (407) Meydenbauer Center
  •Software Evolution and Portability