Step 1. Embrace the mud
As an alternative of giving in to the anger and blame, it’s necessary to appreciate that this Massive Pile of Mud works and places meals on the desk for you and everybody in your organization. Certain, it’s a large number, but it surely pays the payments. You would possibly hate it. It would make you annoyed and offended. However it is advisable simply swallow all of that and transfer on with the job of fixing the pile and making the mud do new issues.
As soon as you’re previous all that, the following factor is to do not forget that the most effective factor to do if you end up in a gap is cease digging. Job one is to not make issues any worse than they already are. Don’t add one other layer of depth to that vast, nested if
assertion. Don’t add 120 extra traces of code to that God class. Don’t observe these outdated patterns of coupling issues collectively and making one factor do fourteen issues and mashing issues collectively. In different phrases, don’t make any extra mud.
Step 2. Apply the Boy Scout rule
The primary normal you need to set is to all the time apply the Boy Scout Rule to your code. That’s, all the time depart it slightly higher and slightly neater than you discovered it. As an illustration, if you happen to discover code that isn’t formatted to the corporate’s formatting requirements, format it correctly. When you discover code that has crappy variable names, change them to be extra descriptive. When you discover code that has traces of code that do seven issues, refactor out to explaining variables. Set a coverage that the time spent bettering code as you run throughout it, even in little methods, is nicely price it.