EXTRACT METHOD (Refining Function)
Summary:
You have a code that can be organized together and stand independent. Put this code into a stand-alone function and let function names explain the purpose of the function.
TIPS:
If each function is small, the chance to take each other is even greater. This will make the high-level function code are like a series of comments If the function is fine, then the overwriting of the function is more easier. The length of a function is not a problem, the key is the semantic distance between the function name and the function body. If the extractive action can enhance the clarity of the code, then do it, it doesn't matter if the function name is longer than the extremished code. Even if the code you want refining is very simple, for example, a message or a function call, as long as the name of the new function can show the code intent in a better way, you should also refine it. But if you think of a more meaningful name, don't move.