且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

你认为"自动接口实现"将在.NET / C#有用

更新时间:2022-12-08 13:32:46

我认为的同样的事情在不久前,特别是用在情况下,你只能有一个生产实现一个接口,但你要模拟它出用于测试。目前,它最终被昔日有点像.C / .h文件。

I considered the same sort of thing a while ago, particularly for use in the case where you only have one production implementation of an interface, but you want to mock it out for testing. At the moment it ends up being a bit like the .c/.h files of yore.

我怀疑在它的好处双方在语言,然后读取code事后额外的复杂性都胜过结束。我仍然有兴趣看到它探索更彻底虽然。即使这样,还有其他对我的优先级列表一路走高的东西 - 对于不变性是在顶部更好的支持:)

I suspect in the end that the benefits of it are outweighed by the extra complexity both in the language and then reading the code afterwards. I'd still be interested in seeing it explored more thoroughly though. Even then, there are other things way higher on my priority list - better support for immutability being at the top :)