Why does _AppDomain have an underscore prefix? Seriously, it seems to me that this is always in my area of ​​intellisense

Whenever I write a new class and add some internal fields, I use the underscore prefix as follows:

private readonly int _foo; 

Why did the .NET team decide to create an AppDomain interface named _AppDomain? It just seems to me that I see it whenever I type an underscore to get class level fields in intellisense. Why is this not an IAppDomain or something else?

Yes, I am very picky ... I know

+4
source share
2 answers

This interface exists for this purpose:

Provides unmanaged code to public members of the System.AppDomain class. This API is not compatible with CLS.

So, I would suggest that for this type there were more relaxed naming conventions. It is hard to say why this was done, but the type certainly does not comply with the Framework Development Guide.

+3
source

Such interfaces interact with the COM environment. for example you can find the _Exception interface.

+2
source

Source: https://habr.com/ru/post/1304375/


All Articles