🔸🔸Long Method 🔹🔹
-
A long method is hard to understand because of too much detail. They tend to become longer, introduce hard-to-detect duplication and often suffer from Primitive Obsession.
-
We like small methods with clear naming that show at a glance what the method does. ➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖ ▪️Recognition: -
🔹Long method
-
▪️Refactoring: -
🔹Replace method with method object -
🔹Replace temp with query -
🔹Decompose conditional -
🔹 Extract method