Click here to Skip to main content
15,881,693 members
Home / Discussions / C#
   

C#

 
GeneralRe: Anyone working with the new VS2019 .Net NI-VISA driver? Pin
SunshineDesign17-Jun-20 7:00
SunshineDesign17-Jun-20 7:00 
AnswerRe: Anyone working with the new VS2019 .Net NI-VISA driver? Pin
Pawel Wzietek30-Jun-20 18:50
Pawel Wzietek30-Jun-20 18:50 
QuestionMultiple Classes, same name Pin
Wiep Corbier15-Jun-20 22:20
Wiep Corbier15-Jun-20 22:20 
AnswerRe: Multiple Classes, same name Pin
Richard Deeming15-Jun-20 22:31
mveRichard Deeming15-Jun-20 22:31 
GeneralRe: Multiple Classes, same name Pin
Wiep Corbier15-Jun-20 22:42
Wiep Corbier15-Jun-20 22:42 
GeneralRe: Multiple Classes, same name Pin
Richard Deeming15-Jun-20 22:47
mveRichard Deeming15-Jun-20 22:47 
GeneralRe: Multiple Classes, same name Pin
Wiep Corbier15-Jun-20 22:56
Wiep Corbier15-Jun-20 22:56 
GeneralRe: Multiple Classes, same name Pin
Richard Deeming15-Jun-20 23:47
mveRichard Deeming15-Jun-20 23:47 
Wiep Corbier wrote:
People will ask, which Richard?
There has to be some way to disambiguate the two people. Usually you would use the surname.

It's no different with classes. If you have two classes with the same name, then they have to be in different namespaces so that you can disambiguate them.

Otherwise, even if you could come up with an intellisense popup to let you pick a class - which could be difficult if the only difference is one character on line 42! - there would be no way to represent that choice in the compiled program.

And before you suggest that the compiler could generate some form of "mangled" name to uniquely identify the class, remember that you'd also have to represent that choice in the source code. And the source code is meant to be read by humans. There are enough arguments against using var when the type isn't clear, without making an explicit variable type ambiguous as well!

Wiep Corbier wrote:
C# (8?) now has the ability to work around null values in classes.
Who asked for that? I didn't.
Who cares? No one.
Lots of people asked for it, and lots of people care. You can probably find the history in the C# Language Design repository:
GitHub - dotnet/csharplang: The official repo for the design of the C# programming language[^]



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer

GeneralRe: Multiple Classes, same name Pin
kalberts16-Jun-20 0:05
kalberts16-Jun-20 0:05 
GeneralRe: Multiple Classes, same name Pin
Richard Deeming16-Jun-20 0:31
mveRichard Deeming16-Jun-20 0:31 
GeneralRe: Multiple Classes, same name Pin
kalberts16-Jun-20 0:44
kalberts16-Jun-20 0:44 
GeneralRe: Multiple Classes, same name Pin
Wiep Corbier16-Jun-20 0:20
Wiep Corbier16-Jun-20 0:20 
GeneralRe: Multiple Classes, same name Pin
Richard Deeming16-Jun-20 0:28
mveRichard Deeming16-Jun-20 0:28 
AnswerRe: Multiple Classes, same name Pin
ZurdoDev16-Jun-20 2:16
professionalZurdoDev16-Jun-20 2:16 
GeneralRe: Multiple Classes, same name Pin
ZurdoDev16-Jun-20 2:18
professionalZurdoDev16-Jun-20 2:18 
GeneralRe: Multiple Classes, same name Pin
Dave Kreskowiak16-Jun-20 3:16
mveDave Kreskowiak16-Jun-20 3:16 
GeneralRe: Multiple Classes, same name Pin
Nelek22-Jun-20 5:53
protectorNelek22-Jun-20 5:53 
AnswerRe: Multiple Classes, same name Pin
OriginalGriff15-Jun-20 22:32
mveOriginalGriff15-Jun-20 22:32 
AnswerRe: Multiple Classes, same name Pin
Richard MacCutchan16-Jun-20 0:27
mveRichard MacCutchan16-Jun-20 0:27 
GeneralRe: Multiple Classes, same name Pin
Wiep Corbier16-Jun-20 0:36
Wiep Corbier16-Jun-20 0:36 
GeneralRe: Multiple Classes, same name Pin
Richard MacCutchan16-Jun-20 0:52
mveRichard MacCutchan16-Jun-20 0:52 
GeneralRe: Multiple Classes, same name Pin
Wiep Corbier16-Jun-20 0:55
Wiep Corbier16-Jun-20 0:55 
GeneralRe: Multiple Classes, same name Pin
Richard MacCutchan16-Jun-20 1:05
mveRichard MacCutchan16-Jun-20 1:05 
GeneralRe: Multiple Classes, same name Pin
Wiep Corbier16-Jun-20 1:17
Wiep Corbier16-Jun-20 1:17 
GeneralRe: Multiple Classes, same name Pin
Richard MacCutchan16-Jun-20 1:37
mveRichard MacCutchan16-Jun-20 1:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.