-
What is the reason behind Hungarian notation in the interfaces? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
Simply because more people were used to it and prefered it, at that time when .NET was created. |
Beta Was this translation helpful? Give feedback.
-
(Type parameters are named this way as well: |
Beta Was this translation helpful? Give feedback.
-
c# doesn't have a keyword to implement interfaces, so you can confuse them with a class. public class ArrayList : List
{
...
} Does it inherit a List class or does it implement a List interface? Since you can't really tell, hungarian notation comes and adds I prefix to explicitly state it's an interface. That's what I think the reason could be though. |
Beta Was this translation helpful? Give feedback.
-
These are basically the same responses recieved yesterday on SO. Are you looking for some sort of different answer? |
Beta Was this translation helpful? Give feedback.
Simply because more people were used to it and prefered it, at that time when .NET was created.
Naming is hard. Java names interfaces by adjectives, like
Enumerable
, to differentiate from classes. But it is not always easy to find a good adjective word. WithI
prefix, it is easy to come up names likeIPlugin
,IAuthorizationHandler
...