Comment the interface, implementation or both?

后端 未结 9 1286
萌比男神i
萌比男神i 2020-12-13 03:08

I imagine that we all (when we can be bothered!) comment our interfaces. e.g.

/// 
/// Foo Interface
/// 
public interface Fo         


        
9条回答
  •  猫巷女王i
    2020-12-13 03:41

    You can certainly comment both but then you have the problem of maintaining both (as previously mentioned). However, in this day and age is any consuming code really not going to be using IoC/DI and not use the interface? Given this if you only want to bother commenting one I would strongly suggest commenting the interface. This way the consumer of your code will more than likely get the nice intellisense hints.

提交回复
热议问题