Home > Best Practices, Never Do That > Code Duplication

Code Duplication

September 24th, 2009 Leave a comment Go to comments

Today at the office I encountered another nightmare. It seems like the author of the code above was doing the development late at night, he sleep in the middle and unintentionally pushed Ctrl-V button.

DuplicationHell

The next day most probably he woke up late and had to continue working on the project coming night. As he didn’t sleep well last night, he got too tired and slept over his keyboard. Yes, you’re already guessing – he pushed Ctrl-V button again.

DuplicationDoubleHell

Here are 2 types of code duplication. The first one exists in a function. The second is the duplication of code among different classes. What I’m suggesting is never do that. Otherwise a chunk of code will appear in my blog and become famous.

  1. No comments yet.
  1. No trackbacks yet.

So that we know you're not a robot, please answer the question below: * Time limit is exhausted. Please reload CAPTCHA.