I was reading through the "Refactoring--By Example" chapter of Test-Driven Development in Microsoft .NET today when I ran across a tip that really stuck out at me:
When you see a block of code with a comment attached to it, it is often a good idea to extract that code into a method and make sure that the method's name conveys the meaning specified by the comment.
In the past, I tended to think of methods as a way to reduce duplication in code. If you have two or more sections of code that are very similar, you create a method that encapsulates that similarity, remove those sections, and replace them with calls to the new method.
What the above quotation makes clear is that methods are more than just a way to reduce duplication and promote reuse. A method should also be used to logically group lines of code together, even if the method is only called once.
This is an important realization one must come to on the road to producing more readable and maintainable code.