Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7695175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:29:19+00:00 2026-05-31T21:29:19+00:00

The only place I’ve seen the Friend modifier used is in the WinForms designer,

  • 0

The only place I’ve seen the Friend modifier used is in the WinForms designer, as alluded to in Why is the modifier set to Friend in Winforms? and VB.NET: what does the 'friend' modifier do?.

The Friend modifier appears to be an almost arbitrarily wide access level that was created to solve some historic architectural problem in VB, I just wonder if anyone has a meaningful continued use for it?

I have had some desires to expose methods only to a given namespace so as to roll the functionalities of a related collection of objects together and manage any of their non-thread-safe methods, while exposing the safe public methods to a wider scope in the same assembly. This access level does not exist yet Friend does. Possibly a corollary question then, is my usage of assemblies and namespaces at odds with what is intended?

In many cases it is not possible to separate functionality into different assemblies because of the strict hierarchy that assemblies have, which leads to having groups of related but separate objects that have access to each other’s unsafe methods.

Edit:
While I know the function of the modifier, I am curious as to what practical purposes people have for it as I have not come across a situation where it would be the right solution.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T21:29:21+00:00Added an answer on May 31, 2026 at 9:29 pm

    What you have is not a language problem but OOP dogma in general.

    The Friend modifier might be confusing because it doesn’t behave as it does in older languages such as C++. The reason why it doesn’t behave the same way is because is not the same.

    The Friend modifier gives access to the declared object in an assembly scope, which means that any class within the assembly can access that object but it will still not be usable for code consuming your assembly. If it helps look also at C# Internal Modifier.

    As to why OOP goes against the C++ way of the Friend Modifier goes beyond my knowledge but perhaps this other SO question might help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is the only place I've ever seen and , or and not listed
The only place I can think to change is the version in my Target
at my working place (php only) we have a base class for database abstraction.
I keep getting this error all over the place where I only have jquery
Is Model only Entity Data Model class of my database? Model as simple place
I'm trying to place a nice border around an image that's 250x250, using only
If i change the Spinner width like below only the up/down arrow place is
I am working on an in-place HTML editor, concentrating on Firefox only right now.
So I have a property NSMutableArray *grades . At the only place where I
I am developing on a windows machine. The only place I need for linux

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.