I&#x27;m not sure I object to just-good-enough solutions, but, there&#x27;s still an awfully large benefit from paying down technical debt, and I hope your students appreciate that.<p>My approach is to pay down the technical debt before starting the next big change. I consider it akin to prepping my work site.  As an example: consider a project where you&#x27;re modifying some large continuously running system in production, creating an alternate codepath to ultimately replace some legacy codepath. You&#x27;ll likely add the new codepath first and then migrate some subset of users to it.<p>There might be some diminishing returns from migrating a long tail of users to the new codepath (perhaps they were better served by the legacy codepath for reasons that don&#x27;t quite justify the maintenance of both codepaths). And even when they&#x27;re migrated, you quite likely don&#x27;t <i>need</i> to rip out the legacy codepath.  So at some point, perhaps before <i>all</i> the users are on the new path and perhaps before you rip out the legacy codepath, you&#x27;ll consider the project a success and move on.<p>To me, that&#x27;s quite reasonable.  But consider then that any project on the same codebase in the future has to account for both of these potential codepaths. That adds an expense to every future change you make, as you have to maintain and support twice as many things. In my experience paying down that debt will pay for itself over the course of an astonishingly few (but greater than zero) number of future changes.<p>I mention greater than zero because quite a lot of systems get decommissioned, for one reason or another. If someone is going to bulk delete your code and everything near it, it doesn&#x27;t really matter how the code smell was right before: the code that smells the least is the code that doesn&#x27;t exist.<p>This is why I make various forms of cleaning up code - in-depth refactoring, deleting all unused code and tests, etc. - not the last thing I do when I finish a project, but rather the first thing I do when I start the next project.  It&#x27;s also much easier to explain why you&#x27;re doing it to outside observers at that point - you&#x27;re doing it not just because it &quot;improves code smell&quot; you&#x27;re doing it because it makes what you&#x27;re trying to do now substantially easier.<p>The only time I think this can start to fail is if you aren&#x27;t the person who would be doing the next project &#x2F; you could do the code cleanup far more efficiently than the person who is doing the next project. In which case this all becomes much more hard, and you should just remember to treat others as you&#x27;d wish to be treated.  But I&#x27;m not sure it totally doesn&#x27;t work -- for the person inheriting your work, getting to do some amount of refactoring and cleanup may well end up being a decent way of them getting to know the codebase better (if they knew it as well as you they could clean it up just the same).