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 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

Ask A Question

Stats

  • Questions 75k
  • Answers 75k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer I don't believe there is. But what would you do… May 11, 2026 at 2:40 pm
  • added an answer Check out NodeXL. It's free (on CodePlex) - with source.… May 11, 2026 at 2:40 pm
  • added an answer The LaTeX kernel has an inbuilt method of doing this,… May 11, 2026 at 2:40 pm

Related Questions

This is something I've pseudo-solved many times and have never quite found a solution
This is something I've always wondered, and I can't find any mention of it
This is something I'm not much consistent about and always curious about what other
This is something I've pondered over for a while, as I've seen both used
This is something i seeem to get a different answer for, every time i

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.