To use the 'I' prefix for interfaces or not to

前端 未结 20 1997
长情又很酷
长情又很酷 2021-02-01 02:54

That is the question? So how big a sin is it not to use this convention when developing a c# project? This convention is widely used in the .NET class library. However, I am not

20条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-01 03:43

    1. It's not a sin per se, it's best practice. It makes things a lot more readable all in all. Also, think about it. IMyClass is the interface to MyClass. It just makes sense, and stops unnecessary confusion. Also remember the : syntax vs. implements/extends. Lastly, you can bypass all of this by simply checking the tooltips/go to in VS, but for pure readability, the standard is important in my opinion.

    2. Not that I'm aware of, but I'm sure they exist.

    3. Haven't seen any, but I'm sure they exist.

提交回复
热议问题