A method should do only one thing
The first rule of functions is that they should be small. The second rule of functions is that they should be smaller than that. Functions should not be 100 lines long. Functions should hardly ever be 20 lines long.
From one of Martin Thompson’s presentations I have learned another – more easily available and intuitive – method of judging wether a method is small enough. What you are supposed to do is to physically cover the part of your screen on which the method is displayed with your hand. If you can’t do that, then it means that your method probably is not small enough and you should consider refactoring it.
The obvious advantages that you gain by following these rules are improved readability and maintainability of your code.
But there is one – less obvious – benefit of writing short methods
How do I know the bytecode size of a given method?
javap -c mypackage.MyClass
which returns bytecode of decompiled class and the size of each method (well actually the size is equal to the byte offset of the last instruction – you can read more about javap HERE).