Show HN: Call 4 Review, Proposed .NET `System.Console` IConsole Abstraction
1–4 of 4 posts
Re: Show HN: Call 4 Review, Proposed .NET `System.Console` IConsole Abstraction
#2so many devs create some type of IConsole to remove the static dependancy to `System.Console` when refactoring I thought it would be great if there was a 'known' interface that we could use each time instead of whipping one up each time
But I can write my own System.Console wrapper, it will be done in less than 40 lines?
It's not about writing a wrapper, that is very easy. It's about setting a standard of interoperability between everyone that uses this as their interface. Since you would have started by writing your own interface, and then also writing something that implements that interface, why not save yourself the 2 or 3 hours you will be sidetracked doing that and dive right in to cleaning up your code.
You can use IConsole as simply as typing, `add package IConsole`. You can always come back later and remove it.
Anyway, I've created a proof of concept as well as a hierarchy of interfaces that allow devs to be explicit about what type of functionality their console app or method or class requires, and should solve save time when refactoring and cleaning up code, making it more testable and-or removing dependancies. (injecting etc).
If you can please take a few minutes and look at the interfaces and the project site on Github, that would be very helpful. Love you all, Alan
Re: Show HN: Call 4 Review, Proposed .NET `System.Console` IConsole Abstraction
#3Re: Show HN: Call 4 Review, Proposed .NET `System.Console` IConsole Abstraction
#4A quick search on github shows more than 21K projects with IConsole interfaces, mmm?