Copy and paste programming by Boipelo Rathebe
A couple a of weeks ago I had a very interesting chat with a java software developer friend of mine, who had just recently started the job and us just having a friendly chat around how he’s finding it, and to my surprise, or not, because I am quite convinced that we all have found ourselves doing “it”. He tells me it is very hectic and this as a result has taken his friendship with google to a whole new level, so basically when he gets stuck he’ll just do an internet search on what he’s struggling with and hopefully get a suitable solution.
By “it” I am referring to the phenomena of copy and paste programming , and I am not referring to reusing a piece of code you previously developed and reusing it, I am referring to going onto the internet and searching a similar problem’s solution and then copying the solution and using it. Although this might seem as the natural way of problem solving it isn’t always the best.
This is indeed a popular phenomenon among developers, and for various reasons of course (i.e. inexperience, time, lack of senior support, inadequate help resources, etc.), I am not in any way suggesting that this isn’t allowed, taking into consideration open source software and all the helpful blogs and websites we find out there, but caution needs to be exercised when doing this.Yes time can be saved, but one should try to fully understand the code they’re copying and what the code actually does, to avoid the following:
· Inheriting the problems of other developers, i.e. Copying code with bugs in it.
· Making it a habit and actually becoming a copier instead of a developer
· Copying poor quality code that doesn’t adhere to development standards
I read in one the articles that in development copy and paste programming has no real advantage, this is the chance for the developer to come up with the best set of abstractions and processes.
But the gist of this article for me is, as developers, in order to grow and become the best in what we do, we need to fully understand the code and logic we’re using at all times. Better yet, there's no thrill in copying and pasting afterall.
Let's be ORIGINAL !!!
Oh below is a long but brialliant piece of T-SQL code you won't regret copying and pasting, guaranteed. Just run it against your SQL Server 2008R2 instance.
For a quick copy,Just hit CTRL+SHIFT+END with your cursor above the word "SELECT".