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

  • Home
  • SEARCH
  • 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 97075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T23:56:07+00:00 2026-05-10T23:56:07+00:00

This is something I’m not much consistent about and always curious about what other

  • 0

This is something I’m not much consistent about and always curious about what other people do.

How do you access internal properties (private or public)?

For example you’ve got this property :

Private _Name As String  Public Property Name() As String     Get         Return _Name     End Get     Set(ByVal value As String)         _Name = value     End Set End Property 

In the same class within another function which one do you prefer? and why?

_Name = 'Johnny' 

or

Name = 'Johnny' 

Ignore the fact that I used Name instead of Me.Name.

  • 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. 2026-05-10T23:56:08+00:00Added an answer on May 10, 2026 at 11:56 pm

    Personally I prefer to use the property where possible. This means you still get the validation, and you can easily put breakpoints on the property access. This doesn’t work where you’re trying to make a change to two properties which validate against each other – for instance, a ‘min and max’ pair, where each has a validation constraint such that min <= max at all times. You might have (C#):

    public void SetMinMax(int min, int max) {     if (max > min)     {         throw new ArgumentOutOfRangeException('max';     }     // We're okay now - no need to validate, so go straight to fields     this.min = min;     this.max = max; } 

    At some point in the future, I’d like to see C# gain the ability to declare the backing field within the property, such that it’s private to just the property:

    public string Name {     string name;      get { return name; }     set     {         if (value == null)         {             throw new ArgumentNullException('value');         }             name = value;     } } 

    Outside the property, you wouldn’t be able to get at name at all, only Name. We already have this for automatically implemented properties, but they can’t contain any logic.

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

Sidebar

Related Questions

This is something that I have always wondered about, but never bothered to profile.
I always thought base.Something was equivalent to ((Parent)this).Something , but apparently that's not the
This is something simple I came up with for this question . I'm not
This is something that I always find a bit hard to explain to others:
This is something I've always wondered, and I can't find any mention of it
This is something that comes up so often I almost stopped thinking about it
Ok this might be simple or just not possible. Probably it's something that is
Something I have been curious about for quite sometime now. How exactly do you
Something like var life= { users : { guys : function(){ this.SOMETHING.mameAndDestroy(this.girls); }, girls
This is something I've pseudo-solved many times and have never quite found a solution

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.