October 2009
Intermediate to advanced
288 pages
5h 2m
English
Rather than start with a lot of explanation, we’ll begin with a quick example of refactoring to show how you can identify problems in code and systematically clean them up. We’ll work “at speed” so you can get the feel of a real session. In later chapters, we’ll touch on theory, provide deeper dives into problems and how you fix them, and explore moderately large examples that you can practice on.
Let’s take a look at a little Ruby script Kevin wrote a while back. The script generates a sparkline (a small graph used to display trends, without detail) and does it by generating an SVG document to describe the graphic. (See Figure 1.1.)
Figure 1.1. A sparkline
The original script was written ...
Read now
Unlock full access