Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • This is a very well written answer and I agree entirely with the approach. In my particular case something this verbose would be overkill to the infinite degree considering the trivial code behind each. To put it in perspective, imagine the code is simply performing a Console.WriteLine(n). That is practically the equivalent of what the code I was working with was doing. In 90% of all other cases, your solution is definitely the best answer when following OOP. Commented Feb 18, 2019 at 13:31
  • Yeah fair point, this approach is not useful in every situation. I wanted to put it here because it's common for developers to get fixated on one particular approach to solving a problem and sometimes it pays to step back and look for alternatives. Commented Feb 18, 2019 at 23:14
  • I completely agree with that, it’s actually the reason I ended up here because I was trying to solve a scalability issue with something another developer wrote out of habit. Commented Feb 18, 2019 at 23:24