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.

Are you ready to upgrade your skills and become a Data Engineer?

Take the next step and sign up for my newsletter. I share exclusive material that you won’t find anywhere else.

Material like when I started my Big Data journey I thought I’d never interview at Google. Now I’ve lost count of how many times I’ve turned down Google. I knew I was a world-class engineer, but I could never demonstrate it during my job searches and interviews.

You have Successfully Subscribed!

Share This