DEV Community

Discussion on: How would You Handle Dirty Code?

 
imben1109 profile image
Ben

What could you do when you are required to deal with them?

Thread Thread
 
jfrankcarr profile image
Frank Carr

If the business is depending on the application that has bad code and it needs to be fixed or enhanced, you just have to get it done as best you can. Since you probably won't have decent regression tests, much less unit tests, you have to be very careful about making any huge changes, like a full refactor.

For example, today I had to deal with an old VB6 application. A small change someone else had made broke another part of the application. It took about 4 hours to track the problem down. I had to implement a fix that would correct the problem without breaking the change that caused it. Eventually, we will replace this app with a new one that uses microservices and a good design pattern. But, until then, we have to be very careful with it.