Now — The most critical moment!!

Leena
Continuous Delivery
2 min readOct 26, 2018
https://quotefancy.com/quote/852064/Leo-Tolstoy-The-most-important-time-is-Now

Recently, someone asked me when is the right time to clean up the code while the team almost all the time is running on a treadmill with releases. I mentioned it is “now”.

There is nothing called the “right time” than now. When we are coding, look for improvements. Rename a variable or method to make it more meaningful. Extract a method or a class, to make it simpler and modularised.

Opportunistic Refactoring is effective and practical than having a “dedicated time for clean up”.

Follow the Boy Scout Rule — Always leave the campground cleaner than you found it

With this approach, there is a danger of getting into a rabbit hole without knowing when to stop. If the idea is to leave the code better than you found it, then we always have the opportunity to improve at the next visit. This judgement comes with practice, with frequent refactoring.

In summary, the idea is to improve little by little in small steps to achieve something big over a period. Small steps are safer. Refactoring is all about that.

Its heart is a series of small behavior preserving transformations. Each transformation (called a “refactoring”) does little, but a sequence of transformations can produce a significant restructuring. Since each refactoring is small, it’s less likely to go wrong. The system is kept fully working after each small refactoring, reducing the chances that a system can get seriously broken during the restructuring.

Create opportunities, don’t wait for it. Constant improvements, instead of improvements with stops and gaps, is the way to avoid debt.

--

--

Leena
Continuous Delivery

Co-founder/CTO @ PracticeNow, Bangalore, India. A strong believer of lean principles, an evangelist and practitioner of Continuous delivery