I have a class called SimpleCommand. It is a single file class that implements ICommand in a very simple way (hence the name).
I am finding that I am putting it several of my projects. (I just copy the code and add it into the project.)
These projects are all in the same solution and resulting wpf application.
My question is: Aside from increasing the size of my DLLs by a bit, what are the drawbacks to copying this code around?
(I am trying to decide if it is worth the work to put it in a nuget package.)
NOTE: I have not changed this code in years, and I don’t plan to.
The issue here isn’t that there are various classes with the same name in different namespaces.
The issue is that you’re duplicating code, which is really bad idea.
If you want to expand your SimpleCommand to ABitMoreComplexCommand you end up copying it all over.
If you need to compare one command to another by type you couldn’t do that reliably – heuristics you may implement could give you false positives
Bottom line: make another project, put all reusable code there, don’t copy it around