I write code in a highly factored style. Part of this is keeping methods short. There are several advantages to small methods:
There are also disadvantages to this style:
But on balance I think short methods are very helpful. Short methods are a powerful technique for writing self-documenting code. When writing a block of code that needs a comment to explain it, consider putting the block in a separate method whose name makes the comment redundant. last change 2004-04-04 14:44:16 |
Keeping methods short leads to flexible and readable code. BlogRoll |
© 2004, Kent Johnson