Do one thing, do it well, do it only
A method should do one thing, and only one thing. It should do it in the best way possible.
A method likely does one thing if
- it has few input parameters
- it doesn’t include Boolean parameters
- it has exactly one output parameter
- it is small
- it descends one level of abstraction
- it only throws one type of exception
- you cannot extract meaningful other methods
- you cannot meaningfully group its statements into sections