Next Page > Hide TOC

Introduction

Contents:

Organization of This Document
See Also


As programmers develop and maintain a software product, despite their best efforts, the changes they make may degrade the quality of the product’s source code. Good-quality source code is easy to understand and allows programmers to get up to date on a project in a short time. In such a project, for example, classes have well-defined responsibilities; they do few things and do them well, Bad-quality source code is hard to understand. The classes in such a project may have several areas of responsibility, making it hard to decide where to add code to implement a new feature.

Projects with good-quality source code tend to lose their quality as they are changed. For example, fixing a set of problems in a product in time to meet a deadline may require making hastily conceived changes that may make the product’s source code harder to understand for people not familiar with the product. New team members, and even the developers who made changes to the source code in the past, may have trouble understanding that same source code as a whole or its individual components at a later date because the purpose of classes and methods is not obvious or clear.

To address this problem, developers use a quality-improvement process called “refactoring.” In short, refactoring makes code easier to understand and maintain without changing the behavior of the product.

This document shows how to perform refactoring operations using Xcode. It does not teach you refactoring.

Organization of This Document

This document contains the following chapters:

See Also

To learn about refactoring, you should consult the books that cover this topic in depth. One such book is Refactoring: Improving the Design of Existing Code, by Martin Fowler. This book provides in-depth discussions about the refactoring process and describes refactorings that solve common problems in source code that make it hard to understand



Next Page > Hide TOC


© 2009 Apple Inc. All Rights Reserved. (Last updated: 2009-01-06)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.