From observing the source code for various Android applications (not written by me), I noticed a pattern of placing certain fragments of code in my own methods, although in fact there is no reuse of the code, because these methods are called only once in the entire application.
So far, I had a rule that dictates that if part of the code is used twice or more in the application code, then it deserves its own method simply because of the elimination of code redundancy.
But, seeing these neatly broken pieces of code in my own methods (and my own invocation of the method call), I begin that maybe I'm missing something.
In addition, for documentation purposes, what other reasons can justify entering only 4 lines of code (which are called only once!) In your own method?
an00b source
share