Recently I’ve been working with lots and lots of legacy code written by lots and lots of people who have been separated by lots and lots of distance between them. As a side effect, a lot of the code has comments that either explain what is going on, rationale behind doing it, and sometimes even a comment providing an excuse or justification and suggesting a way it should be done. It had reminded me of a time on a previous team when we had a new guy with years of experience of solo coding and almost everytime he worked on something he put big huge comments all over the place along the lines of :
/* Here we are using string literals but we should really be using object references */
Which faithfully stayed there for months until someone came across it, yanked it out, and asked him to next time please discuss with us or just do it… we are sitting next to each other after all!
Okay… I’m not predicting facebook’s death by apps… not by any means. But the overall pleasantness of using facebook has definitely dwindled lately with all the freaking app invites I keep getting. I mean good lord, why must I have about 30 app inivites weekly!?
The worst thing? Most of the people using these apps don’t even mean to bother me to death with them. Either (a) it forces them to invite their friends to use the app in order to see their quiz results, or (b) it randomly invites their friends each time they use it. Ugh.
I just hope there’s some relief in sight… otherwise, facebook will be just as bad as myspace.
Let me forwarn you that you may be offended by this post… it may come off as a bit hostile and derogatory, but it’s just something I need to get off my chest. When someone thinks it’s entirely acceptable to write a 300 line method and call it “the quickest and simplest thing to do that works” and then copy and paste those 300 lines 10 times and modify maybe one or two variables to cover other scenarios, you don’t deserve to even have a job programming.
I’m sorry, but I don’t care what your time constraints are. I don’t care that you just learned the language. And I don’t care you sat down and thought “OMGZ! I need to get this done yesterday!” The fact that you did not just try to use that thing you call a brain and THINK about what you were doing and just reduced yourself to a CTRL+C and CTRL+V keyboard monkey reduces any possiblity that I could respect you as a programmer. Honestly, did you get through school by copying homework assignments? Did you get the genius next door to do your work for you while you were out partying, and luckily had awesome memorization skills to pass exams?
A skilled craftsman is one who devotes their time and energy to honing their skill. They may start out knowing very little, but through dedication and at least using their brain they improve, and even if their code isn’t perfect, at least they gave it effort. By just mindlessly copy and pasting you didn’t even make an effort… you’re just lazy.
When you need to do something similar to something else, maybe it’s okay to copy and paste the first time, change a few things, then look at what you can do to consilidate both tasks and make the same code useable in both situations. But doing the whole copy and paste and saying “I’ll refactor it later” is idiotic… you know that “later” is never going to come, and with that attitude you’re just going to keep doing it over and over to the point that “refactoring it later” will take you 30 days.
Let’s just be honest to ourselves… there’s really no reason you should copy and paste your code. Period.