This is Bad Code!
"This is bad code!” To a software engineer, those can be fighting words. Few things can put us on the defensive like an outright attack on something we created. But should it? As Mark Nijhof points out in his blog, when he says that some code is bad, what he means is ”that the code _is_ bad. But this has _nothing_ to do with the person who wrote the code.”
Learning to give as well as receive constructive criticism can create teachable moments.
The first step in giving constructive criticism is to choose the time and place to bring it up. Monday morning in front of the coffee pot/pop machine/boss’s office surrounded by ten other engineers is NOT as appropriate place to point out the glaring memory leak in a coworker’s code. Follow Mark’s advice:
I am not saying you should confront the person in an offensive way, or in front of many others, that will never work. Ask if you can discuss a certain part of the code, because you have some questions / concerns about it. Then you can discuss the code and offer your advice and show what can be done to improve the code. Especially showing what to do is extremely important, because that is how someone can improve.
On the other side of the coin, make sure that you are receptive when someone approaches you with some constructive criticism. We all make mistakes. It doesn’t matter if you are a Senior Software Engineer with a decade of experience or a newbie out of college, bad code still happens. Again, Mark offers some advice for receiving criticism:
So when somebody actually comes to you with some concerns about a solution you created, try to see this in a positive light. Embrace it and look at it as a moment to improve yourself. As you have already read there are not many of such moments, so use them well. And whether or not if the person is right you should be thanking him for bringing it up, encourage him to do it again. And return the favor.
Keeping it about the code, and not about the coder, is a good way to keep it positive. Attacking the developer in a negative way in front of his or her peers is a good way to instigate a UFC style throw down. Use constructive criticism to create those teachable moments, and your company won’t have to install an octagon in the break room.

Comments
Be the first to comment!
Leave A Comment