Step 1. Embrace the mud
As a substitute of giving in to the anger and blame, it’s vital to understand that this Large Pile of Mud works and places meals on the desk for you and everybody in your organization. Certain, it’s a multitude, however it pays the payments. You would possibly hate it. It’d make you annoyed and offended. However you must 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 might be previous all that, the following factor is to do not forget that one of the best 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 strains of code to that God class. Don’t comply with these previous 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 customary it is best to set is to all the time apply the Boy Scout Rule to your code. That’s, all the time depart it a bit higher and a bit neater than you discovered it. As an illustration, in case you discover code that isn’t formatted to the corporate’s formatting requirements, format it correctly. Should you discover code that has crappy variable names, change them to be extra descriptive. Should you discover code that has strains of code that do seven issues, refactor out to explaining variables. Set a coverage that the time spent enhancing code as you run throughout it, even in little methods, is properly price it.
