I ran into this comment in some code and just had to laugh (and refactor it).
/** Â * Note: The code has some copy/paste code. Because it can't integrate to a method. Â *Â Â Â Â Â Â The parameter painter can't be changed when drawing. * If it newly twice when drawing, the text may not be shown. Â */
The code was written by a very, very junior programmer.Â It turns out that he was wrong about being unable to refactor it.Â He just needed to create a new class.Â The code that he wrote was unmanageable and led to bugs.Â When fixing an issue on one side, you had to remember to fix it on the other side.Â Refactoring it led to half the code to maintain and a class that could be used again.
I talked to programmer for a large company in Reno who spent most of his time looking for copy and pasted code.Â It was his job to refactor it into a library.
So please for my sanity’s sake, don’t copy and paste code on the off chance I have to work on it.Â If you feel the need to copy and paste, chances are it should be in a common class or a library somewhere.