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 8975809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:58:27+00:00 2026-06-15T18:58:27+00:00

This is ok in C# : private int total; public int Total { get

  • 0

This is ok in C#:

private int total;
public int Total {
    get {
        return total;
    }
}

So the backing field total is spelled the same as the Property Total with the only thing telling them apart being the case of the T.

With VB.NET VS complains if I try to do the following. In fact it won’t even let me write Return total with a lower case t and auto-corrects to an upper case T

enter image description here

But if I spell the backing field differently then it seems to be ok:

Private fTotal As Integer
Public ReadOnly Property Total() As Integer
    Get
        Return fTotal
    End Get
End Property

I realize they are different languages but is there a logical reason behind this difference? (EDIT originally said “apparent inconsistency” rather than “difference”)

Also – I assume even though Visual Studio auto-corrects the case of my VB.NET but in reality this language is not case-sensitive?

  • 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-06-15T18:58:28+00:00Added an answer on June 15, 2026 at 6:58 pm

    I realize they are different languages but is there a logical reason behind this apparent inconsistency?

    The original reason is simply historical: VB is based on BASIC which, like other languages at the time (FORTRAN) was case insensitive (but was usually written in all-uppercase).

    Furthermore, I don’t see any inconsistency: inside VB, the casing is entirely consistent. In particular, it’s not “sort of case-sensitive” as your title asks.

    There is a logical reason to be case insensitive, even today: it makes it harder to introduce bugs due to name clashes; consider the following C# code:

    private int total;
    
    public int Total {
        get { return total; }
        set { Total = value; }
    }
    

    Did you spot the error immediately? If so, not bad (the syntax highlight here helps). In VB, this class of errors cannot happen. But in practice I think this class of bugs isn’t all that problematic because once identified they are easily eliminated. So while this is a reason for case insensitivity, it’s not a very strong one.

    Finally, notice that Windows and OS X file systems use the same convention as VB here: the file system is case insensitive (filename case doesn’t matter) but case aware – meaning the file system preserves the original casing of a filename and displays it correctly but when comparing, it doesn’t consider case.

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

Sidebar

Related Questions

Let's assume this class in C#: public class LimitedList<T> : List<T> { private int
I have this small class looking like this: private static int field1 = -
Is there a way to improve this: private static int CountNewlines(string s) { int
I have overloaded the + operator like this class sample { private : int
Suppose you have a simple class like this: class foo{ private: int* mData; int
From time to time I see something like this: class Clazz { private int
I found this code using Google. private int RandomNumber(int min, int max) { Random
This is the error occurs in logcat,can anyone tell what's the meaning? private int
Right now, I have to do this private delegate void set(int obj); //declare the
Okay, I have something like this in C++: class MyClass{ private: int someVariable; int

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.