October 2013
Intermediate to advanced
368 pages
9h 20m
English
Legacy code challenges tend to induce the strong motivator of fear into even the most senior developers. Consider having to specialize a small part of a longer, untested function. Imagine that getting your feature implemented is a matter of introducing three lines worth of variant behavior in the midst of thirty lines. As an experienced programmer, you know that the right design would involve factoring common behavior to a common place. The template method design pattern represents one acceptable solution.
(Another solution would involve introducing a conditional. But that’s often a recipe for gradual decay, as functions become weighted down with flags and nested blocks.)
Yet, also from the stance of experience, many programmers ...