Conformize the function

xiaoxiao2021-03-06  110

Inline method (inline function)

Updated on Wednesday, November 10, 2004

Summary:

The function of the internal linkage, the Method Body is also clearly understood from the Method Name, then insert the function ontology in the call point of the function to eliminate the function. TIPS:

If you have a group of organizers in your hand, you can try to put them into a large function, and then extract the reasonable small functions. If the indirect layer causes the logic to be more confusing between each function, you can try to remove the unnecessary indirect layer. Comments by Allen Lee:

The behavior of Inline Method and Extract Method is the opposite, the former inserts the function of the function into the caller to eliminate the function itself, and the latter separately extracts the relevant code separately forms a separate function. Inline method is generally clarified to eliminate unnecessary calls, clamping the context of each part; Extract Method will clarify the logical threads of each part by increasing reusability.

转载请注明原文地址:https://www.9cbs.com/read-104504.html

New Post(0)