Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27329

[RESOLVED] Member and property with same name

$
0
0
This may sound like a bizarre question coming from me, but can somebody with VB and C# experience tell me whether it is EVER reasonable to have a class with a public data member and a public property with the same name (the property takes an argument, too, and the two are totally unrelated in purpose)? It's a really bad idea, and it shouldn't compile because of the ambiguity in the name, but I have run into something like this. I have a suspicion that the code might have been written in a different language, which is quite possibly C#, and was run through a pretty bad language translator. What I am really wondering is whether or not there is anything that can be done validly in C# that could be poorly, and automatically, translated in such a way that it would result in the situation I described?

Viewing all articles
Browse latest Browse all 27329

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>