Album Cover

Legacy Code Java

Close Preview
In AssetReport.execute() method we saw earlier, what does the variable r do?
Uh, wait.

Here, let me take a look. Uhhhh, yeah, r, yeah, here it is.

It's the sum of the—no, it's the product of the—

Uhhhhh. I don't know what it does.
That's right: you don't know.
The first key to clarity is to take control of the names of things.
Instead of starting with a refactoring, say, to an AbstractFactory, try starting by doing nothing more than:
  1. Reading the code.
  2. Capturing the knowledge you gain by renaming things.
Remember: The biggest revealer of intention is the names you give things.
| Tweet...
Page rating: | Rate this Page