Why prefix C# interface names with an “I”

前端 未结 18 1577
清歌不尽
清歌不尽 2021-02-01 03:13

What is the rationale behind this naming convention?

I don\'t see any benefit. The extra prefix just pollutes the API.

My thinking is inline with Konrad\'s respo

18条回答
  •  粉色の甜心
    2021-02-01 04:03

    I think that the IInterface naming convention is silly. It's an example of Hungarian notation, and I subscribe to the school of thought that despises Hungarian notation. If you have an interface with only one implementation that has the same name, consider the possibility that this is a code smell.

    However, I still use it, because in this case IInterface is recommended by Microsoft, and "standard is better than better".

提交回复
热议问题