开发者

Why is _AppDomain prefixed with an underscore? Seriously, it bugs me that it is always in my field intellisense

Whenever I write a new class and add some internal fields, I use an underscore prefix like so:

private readonly int _foo;

Why did the .NET team decide to create an AppDomain interface with the name _AppDomain? It just bugs me to开发者_JS百科 see it whenever I type an underscore to get my class level fields in intellisense. Why isn't it IAppDomain or something else?

Yes, I am very picky... I know


That interface exists for this purpose:

Exposes the public members of the System.AppDomain class to unmanaged code. This API is not CLS-compliant.

So I would imagine that as such there were more relaxed naming conventions for this type. It is hard to say why this was done though but the type most certainly does not conform to the Framework Design Guidelines.


Such interfaces are made to interact with COM environment. e.g. you can find _Exception interface.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜