Getting Folks to see Their Work Objectively isn’t Easy

cubeLifeView.gif

Today I had to clean up a mess of code that another developer made. He started with a xmlrpc python server/script that a co-worker wrote, and modified it so that it wasn't really working anymore. I then fixed that up to work, but didn't work on optimizing it for speed. I just needed to get it working first. Then, as I worked on a simpler case to get the speed up, he worked on adding a few features.

I finally got an sub-set implementation that promised to have a solid improvement in the speed and put the changed code into my version of the server. He tried it, but the changes he'd made on his end had been too much to work as-is, and he asked me if I could retrofit my changes into his current code base. I had a look at it and the code was a horrible mess.

This guy is not a trained developer. In fact, his development experience is really scripting for the last several years and that's it. No real significant formal training. He's typical of those developers that hack, print variables, hack some more... copy/paste... never really trying to see what he's doing and try to have a cohesive body of code. But in the end, more times than not, they hack something together that technically works.

I spent over two hours this morning cleaning up his code to get it into a maintainable state. Not adding new features, mind you - just cleaning up the crud. When I told him this was a mess, he got quite defensive, as I expected he would. It's something I've run into time and time again. People know the truth, but they want to deny it because "it works".

Well... it may work, but it's a mess. It's not maintainable. It's going to get worse and worse until at some point it'll be impossible to make a change to it. It's brittle, overly verbose, and lacking any real design. In short, it's a disaster waiting to happen.

I don't enjoy saying it's a mess to people doing the best they can do. But in the end, if they don't see it themselves, someone has to tell them or the overall product will suffer. And suffer badly. It took about twenty minutes but I talked him back from his anger/defensive position, so that he realized that I wasn't commenting about him, only the work. He needed to call in help earlier to minimize the work in this kind of merge. I'm not sure he got it all, but I'm hoping he did... at least enough so that he asks earlier next time.