Why doesn't c# have Friend keyword like VB.Net

  • Thread starter Thread starter Steve
  • Start date Start date
Steve,
*Friend* keyword in VB is not the same as *friend* in c++. .NET doesn't
support *friend visibility* and it is not a matter of language. VB *Friend*
is equivalent to *internal* in c#

B\rgds
100
 
Yes, C++ had a friend concept, and this is exactly why it isn't called
"friend" in C#---so it wouldn't confuse C++ programmers who would expect
friend to work like it does in C++.

Friend in VB.NET works like Friend in VB6, which is also how internal works
in C#.

And to Nick: I wouldn't say "protected internal" is the same as VB's
"Friend" because VB.NET also has a combination of "Friend" and
"Protected" --- "Protected Friend".

--Matthew W. Jackson
 
Back
Top