Copy and Paste Does Not a Programmer Make
October 28th, 2008
As any experienced programmer knows, using existing, well proven code for new applications can greatly reduce development time. It can also remove some of the uncertainty in a project by reusing code that is a known quantity. In addition to reusing code you or a teammate has used already in a current or past project, using code from various resources on the web can provide a speedy way to get a new technology into your project. The one requirement for doing this successfully is that you have to know what you are doing. This requirement was something that became very apparent to me during my final few months at Cover-All.
At the end of my time at Cover-All I was in charge of three other programmers. I’ll refer to them as the good, the bad and the kid. The kid was the newest member of the team and the youngest. The good was one of the best programmers I have ever worked with. Finally, the bad was, in reality, not a programmer. He was trained as a CAD guy and evolved into a role as a programmer, but despite that he never really became a programmer. He just didn’t care about getting better at programming and didn’t want to actually learn the tech he was using. As you have probably guessed, the rest of this post is about the bad. The non-programmer.
It really is amazing how far someone can get with a very minimal skillset and a good library of code to draw from. The bad would typically follow the same methodology for each project he worked on. Step one would be to find a piece or pieces of code (either from elsewhere in our projects or from somewhere on the web) which had the same or similar functionality to that which he wanted to implement. Step two would would be to copy it into the project he was working on and make the modifications he thought were required to make meet his needs. That last bit is key and it is what separates the good from the bad.
A good programmer takes the time to understand the code that he is using – whether it is code he has written beforehand, code another dev wrote in the same or another project or code that he has found on the web. It is this understanding which makes everything come together. The bad usually did not understand the code he was trying to use and would end up with completely non-functional code. Code he would invariably send to the good with the subject line “what’s wrong with this?”. After a few weeks of the good doing all of the difficult parts of his work, I told the good it was okay for him to tell the bad to do his own work.
The full extent of just how bad the bad was only became apparent to me during my last week at Cover-All. He was working on adding some functionality to an aspx page that the good had created to display a listing of parts which had been added to an order. The good had done a very good job of creating the page – he had placed a datagrid on the form and was populating it dynamically using a datasource in the code-behind, and updated via AJAX. The bad, when faced with this page was completely unable to understand what was being done there and therefore could not add the functionality he needed. So, after being told to do his own work yet again, he did some googling and came up with something. A few hours later he was again asking the good why no text was showing up on his page at all – he had even broken that which had been working. The good took a look at his work and asked, “Where did all of my code go?”. The response was a chilling, “I found a better way.”. That better way was to remove the datagrid and remove the code-behind and fill the aspx page with a tonne of inline asp. It turns out that the bad doesn’t know that there is a difference between asp and asp.net.
The moral of this little story is twofold. First, if you are a programmer and you have an honest desire to become better at what you do, using code written by other developers can be a great resource for learning new techniques and new technologies. Just make sure that you take the necessary time to understand the code you are using. Secondly, if you are working with someone who seems to be asking for a lot of help with code that he didn’t write himself, you might want to think twice about solving his problems for him. He might be a little inexperienced and trying to use code a little beyond his abilities (in that case, you’ll want to encourage him to spend more time on understanding the code he uses) or he may be your own version of the bad and he might be using your help and other people’s code as a crutch for his lack of real skill.

