QUESTION 2 Which of the following is true about the Extract function refactoring technqiue 1.The technique might require introducing state variables to the class 2.The extracted function will have no parameters 3.When applied, local variables from the original (refactored function) that are used in the extracted code are passed as parameters to the extracted function 4. Apply only if the original function size exceeds 50 lines of code.
QUESTION 2 Which of the following is true about the Extract function refactoring technqiue
1.The technique might require introducing state variables to the class
2.The extracted function will have no parameters
3.When applied, local variables from the original (refactored function) that are used in the extracted code are passed as parameters to the extracted function
4. Apply only if the original function size exceeds 50 lines of code.
Introduction:
Refactoring is the process of modifying existing code to improve its readability, maintainability, and efficiency without changing its functionality. The Extract function refactoring technique is used to simplify complex functions by breaking them down into smaller, more manageable pieces. In this technique, a block of code within a function is identified and extracted into a separate function that can be called from the original function.
Step by step
Solved in 3 steps