December 6, 2007

...Learn TDD with Codemanship

Shorter Methods Helps Localise The Ripple Effect

Today I have been mostly standing up in front of people talking about design quality, the ripple effect, metrics and dashboards.

And as I heard the words spewing forth from my unruly gob, I had a revelation of my own:

Favouring shorter methods with a single, clear responsibility is actually as much about managing dependencies as it's about managing complexity or testability or whatever. Think about it: if you have fewer methods containing more code, then you're going to end up with more dependencies between those methods (because we've got to join the logic up with method calls) and methods that are individually more likely to change. In forest fire terms, biggers trees that are more likely to catch fire, and more likely to spread fire to other trees.
Posted 12 years, 11 months ago on December 6, 2007