According to the article code smells or “technical debt” increases the time to fix bugs and the number of bugs in code. While a few code smells may not be a big issue these smells increase and can make the code harder to debug and ultimately waste time. In fact, according to Bavota, they found code smells were rarely removed when studying over 10,000 refactor focused commits (Bavota & Russo, 2016). An example of a code smell could be repeating code which can extend the length of a class needlessly, shown in Figure 1.

Figure 1Dry code Smell
In this instance it would make much more sense to dedicate a function that provides the same functionality preventing repetition(Christiaan Verwijs, 2021). Also, rewriting the same code becomes cumbersome and painful to debug in a large database. This means a single function will be called for both calculate_shipping_cost and calculate_tax and if any issues arise then you can just refer to the function that replaced the code.
Given this, I plan to review my code before pushing changes and annotate parts where I believe code smell is an issue. While I may need to do something dirty to continue when I’m stuck this means I can still progress then back to clean up. This prevents me from making my code too large and unmanageable while still being able to make progress and not worry about the perfect implementation at that moment. While this may not be the best way, sometimes I get frustrated and start to focus on other things which makes me take longer. This allows me to progress and stay involved with my current task.
References
Bavota, G., & Russo, B. (2016). A large-scale empirical study on self-admitted technical debt. 315–326. https://doi.org/10.1145/2901739.2901742
Christiaan Verwijs. (2021, December 20). In-Depth: What Scientific Research Has To Say About Technical Debt And Code Smells. Medium; The Liberators. https://medium.com/the-liberators/on-technical-debt-and-code-smells-ae8de66f0f8b