I had created a extension method which extended the string type in C#.
// actually checks if the string is empty or null and then looks up the default // promotion code which is set in the backend admin system. promocode.HasPromode();
I thought that was fine and dandy, but another colleague thought I should inject the method through constructor injection, which should implement a interface. I think this is overkill to have a simple lookup function to do that.
Another colleague thought that extending the string type makes it simpler to use it wrong and exposes it for the wrong purposes.
Which one is right? All solutions work fine; but some of these solutions should be the best one, or does it matter actually? It should matter, because we are having those discussions and we're trying to make the code better.