3 ms·
I think focusing on method length is focusing on the wrong thing. Some of the worst long methods I've seen weren't bad because they were long, they were bad be
by curtis 18y ago
I think focusing on method length is focusing on the wrong thing. Some of the worst long methods I've seen weren't bad because they were long, they were bad because they had about eight or nine levels of nesting. When a method ends with
}
}
}
}
}
}
}
}
you know you've got a problem. Breaking such a method up into smaller methods would make each shorter, but the big win would come from eliminating the deep nesting.
- michael_dorfman 18y agoFortunately, we've got McCabe's Cyclometric Complexity to guide us here.