Listing 1 is the implementation of a linked list in C++.
Listing 1: | Linkedlist |
This linked list is useful for maintaining a list of characters. However, it is not very useful for anything else. Of course, we can change the source code, locate all the char types, and replace those with whatever type we want the payload to be. But that means massive copy-paste-modify operations.
Copy-paste-modify is a very bad practice because if we decide to change or enhance the implementation of a linked list, then we have many copies of the original code to modify.