Code reuse, why copy/paste is the enemy!

Test appropriately in UAT, yelling won't help for long...I had to fix a loose railing on the deck, so I took out my trusty cordless drill/driver and a couple of screws, and presto, tested and fixed. The following week I had to fix a loose section of fence in my yard, so I took out the same gadget, along with longer screws that required a different driver bit. Now I could have went out and bought another drill/driver because I needed to use a different bit, but why do that when I had one that already works, all I needed to do was change the bit, right?

The same applies to accomplishing a programming task. During the process of developing a module, you realize that you need to perform a specific operation. You search through the source and find a method does almost exactly what you need, except for one statement, which needs to behave differently. So, you wade through your limited supply of options, which are:

Continue reading