Some short questions are not visible. Usually teachers hides their visibility if they are few in number. Subject Expert recommends them to have more than 70+ questions against the topic and make them public.
1
Write and briefly explain the guidelines for refactoring.
Answer
we must consider following guidelines during refactoring our code:
Refactor when you add a routine:
When you add a routine, check whether related routines are well organized. If not, refactor them.
Refactor when you add a class:
Adding a class often brings issues with existing code to the fore.
Use this time as an opportunity to refactor related to the class you’re adding.
Refactor when you fix a defect:
Use the understanding you gain from fixing a bug to improve other code that might be prone to similar defects.