DEV Community

Discussion on: The Antipattern Antipattern

Collapse
 
dwilmer profile image
Daan Wilmer

Looking at the list of anti-patterns on Wikipedia, the best candidate for being an antipattern antipattern would be copy-paste programming. There is value in copy-paste programming, depending on context. One case would be in an early version of your software, where you would first copy-paste some things to get your code running and then try to abstract where beneficial.

Another case is something that was mentioned in a lecture I attended 6 or 7 years ago, so I don't remember the details. There is a lot of code duplication in some of the Linux drivers, and I think it was the graphics drivers. IIRC, the drivers are responsible for a lot of configuration, which is of course very similar between similar graphics cards. Of course there is a lot of code shared and abstracted away, but there was still a lot of copy-pasting of code. And, for this particular use case, it was the best implementation (or at least a local optimum).