Refactoring

The process that was just performed—separating a unit of code into a set of separate functions—is called refactoring. This is a critical activity when creating a complex program, especially when doing so by evolving it from a simpler form.

Many programmers believe that the act of improving (often called enhancing) or repairing a program inevitably makes that program more complex and harder to understand. However, if maintenance of this sort is used as an opportunity for refactoring, it can actually improve the program. And some programmers (the author included) believe that refactoring programs is a worthwhile activity in itself, separate from enhancement or repair.

In this case, the activity of refactoring is fairly simple. In fact, ...

Get SAMS Teach Yourself C++ in 10 Minutes SECOND EDITION now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.