Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use of I as personal pronoun in interface names

Back in my COM days, it was common to use the I in interface names as a personal pronoun, as if the object was describing what it could do. ie:

IProvideData

Is this still the case in the world of .Net, or it is now preffered to use the third person:

IDataProvider
like image 920
GazTheDestroyer Avatar asked Jun 30 '26 03:06

GazTheDestroyer


1 Answers

Quoted from the naming guidelines:

Do name classes, interfaces, and value types with nouns, noun phrases, or occasionally adjective phrases

Given that, IDataProvider seems like a better name than IProvideData. I find it more logical, especially when paired with member names. IDataProvider.GetData seems more natural to me than IProvideData.GetData.

Read more in Names of Classes, Structs, and Interfaces in the Design Guidelines for Developing Class Libraries.

like image 110
Fredrik Mörk Avatar answered Jul 01 '26 16:07

Fredrik Mörk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!