What I mean when I say, “This is Bad code”
But that way nobody learns, a golden opportunity for the author of the bad code to learn a better way and improve his skills, forever gone, out the window. Hey and also for me, I am often wrong, so explain it to me.
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.
I for one want people to tell me when and where I can improve, I often ask what others think of certain solutions I created and about the presentations I did. Often the response is positive, now this is not because I am so good (I wish), it has to do with the fact that people expect that that is what you want to hear. I sometimes actually have to say, so where can I improve? I want to hear what I do wrong, that is how I learn.
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.
Because trust me, when someone takes the time and energy to come to you and talk about his concerns it is because he is generally acting in goodwill. If he wanted to make a fool out of you then he would have done so publicly perhaps even submitted the code here.
I hope that from now on you will be happy when someone tells you that you wrote bad code. Because you know that this is one of those rare opportunities that you can use to improve your skills to become even better at what you do. Next time I do something wrong, please tell me!
Great blog. We ALL write bad code at times. You are absolutely correct that we should view critiques of bad code as a learning experience instead of an attack. Learning to give and accept constructive criticism is paramount for a good working environment.
Paul Bourdeaux, Thursday, March 05, 2009 at 1:58 PM
It's hard to take criticism, but what doesn't make it easier is that good critics are not always the ones that can bring their criticism constructively. One of my colleagues is extremely good at being a software engineer and I find his criticisms very valuable, but I cannot escape the feeling that some other colleagues don't listen nearly enough to him, because he's pretty blunt in the way he puts his criticism forth. Of course, some people can't be appeased, no matter how you explain what's wrong with their approach, but if you encounter a lot of opposition when being critical of someones work, you might get better results when you actively try to bring it in a 'nice' way.
Ivo, Friday, March 06, 2009 at 5:39 AM
Recent blog posts
- Follow me @ Elegant Code
- CQRS à la Greg Young
- CQRS à la Greg Young example code
- My Kindle DX
- My book: Are You Better Than Yesterday?
- Running with Scissors
- Applying Domain-Driven Design and Patterns
- Hey Developer, YAGNI I tell you
- Hey Developer, the product you create is your code
- NDC videos are published







Nice writeup, and so true!
phx, Thursday, March 05, 2009 at 9:35 AM