Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
One problem you'll inevitably encounter when programming is code duplication. Sometimes it's because of the sheer quantity of code; other times it's the result of a lazy programmer. Either way, code duplication can cause a whole world of pain if not dealt with; from simply wasting your time creating it all, to completely ruining your day because you've got to edit 50 different lines of the same code.
Now, anyone with their head screwed on is probably wondering why you would ever duplicate code. What's the point? The simple answer is that some pieces of code will be used over and over again because you want to perform a similar action multiple times. For example, a piece of code that lets you output a full name by combining a first name and last name: