Types of Refactor

Posted 3 years, 9 months ago | Originally written on 16 Oct 2020

Name refactor - rename an entity (variable, function/method, class) for clarity in order to reduce logical tension

Extract variable - if a sequence of logic starts repeating itself it's time to create an entity from the snippet

Extract method/function

Extract class - inheritance

Extract module - when you begin to see a recurring theme around a group of entities then it's time to isolate them into their own module

Extract package - same but applies to a collection of modules that harmoniously work together

Inline - getting rid of unnecessary variables