Happy Collision

You are headed to add a new piece of code. Unbeknownst to you, it already exists in the system. If you find out about the pre-existing code, you have had a HappyCollision. If you don't, duplication has stealthily propagated.

If you want more HappyCollisions, try to: Meeting... perhaps advisable to circulate the idea before writing the code!

It is surprising how often this can bite you in the behind even in a one man project. On my path to building the HtagLanguage system for web development I came across a spurious problem (bug). It seemed to stem from the urlencoding routines. Strangely when logging code was added the routine was obviously not entered. Eventually it turned out that there were no less then 3 different sets of urlencode and urldecode both as methods and as functions. And each one could be called depending on scoping and location in the class hierarchy. The highest grade of duplication and code smell! So maybe it would be useful to have standup meetings with oneself as well.

Is there XP advice I can follow in very large one-man "team" efforts? -- SvenNeumann

Check out ExtremeProgrammingForOne.

Take a look at PeeEmDee's cut and paste detection tool: CpdTool. Run this periodically or even just towards the end of an iteration. -- AdewaleOshineye

Also see other duplication-finding tools: CategoryDuplicationFindingTool

See AccidentalLinking in wiki.

View edit of June 5, 2011 or FindPage with title or text search