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.
精彩评论