Monday, June 06, 2005

Strategy 4 - Too many loops

If there are too many loops in your code the responsibility is in the wrong place.

Refactor. Each method should have about 1 loop. I find drawing a sequence diagram here quite useful. Usually you need to inject another object or push the inner loops elsewhere.

0 Comments:

Post a Comment

<< Home