Technology

CppCon 2019: Maintainability and Refactoring Impact of Higher-Level Design Features

Titus Winter

Multi-step refactoring

  • Basic atoms of refactoring

Rename a type

namespace oldns {class StringPiece ...}
namespace absl {class string_view ...copy StringPiece }
problems

or

namespace oldns {using StringPiece = absl::string_view}


break with forward declaration. forward declarations no real performance improement

also, ADL causes it to break

instead

namespace oldns {class StringPiece...}
namespace absl { using string_view = oldns::StringPiece;}

then deal with ADL problems

Find a way tso pre/post syntax/semancs can co-exist

Can we change functions?

  • small atoms: weaken preconditions; stregthen postconditions
  • large atomes: opposite

Changing return types

  • void to anything is doable
  • into to int64_t?

Can we change templates

Can we change concepts

  • Single-step: sure
  • Multi-step: No

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 )

Facebook photo

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

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.