O'Reilly logo

Pro PHP Refactoring by Jacopo Romei, Francesco Trucchia

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

C H A P T E R  7

image

Structuring Behavior

A big problem in taming the beast of old legacy code often arises from a method's length. Methods can be too long, too short, overused, or underused. Long methods are hard to keep in mind at once with all their meaning, while short ones can be not meaningful enough. Misused methods can compromise a clean structure by adding unwanted complexity.

In both cases we have to refactor our code to improve its readability, its logical structure, and to keep undesired complexity out of our way. Most of the refactoring techniques we'll see in this book are based on the collection of refactoring methods published by ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required