Click here to Skip to main content
14,429,899 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
 
GeneralI'm completely stumped. At least for now. Pin
honey the codewitch6-Dec-19 5:28
mvahoney the codewitch6-Dec-19 5:28 
GeneralRe: I'm completely stumped. At least for now. Pin
Greg Utas6-Dec-19 5:51
professionalGreg Utas6-Dec-19 5:51 
GeneralRe: I'm completely stumped. At least for now. Pin
honey the codewitch6-Dec-19 5:56
mvahoney the codewitch6-Dec-19 5:56 
GeneralRe: I'm completely stumped. At least for now. Pin
Greg Utas6-Dec-19 6:17
professionalGreg Utas6-Dec-19 6:17 
GeneralRe: I'm completely stumped. At least for now. Pin
honey the codewitch6-Dec-19 6:33
mvahoney the codewitch6-Dec-19 6:33 
GeneralRe: I'm completely stumped. At least for now. Pin
Richard Andrew x646-Dec-19 10:51
professionalRichard Andrew x646-Dec-19 10:51 
GeneralRe: I'm completely stumped. At least for now. Pin
honey the codewitch6-Dec-19 13:06
mvahoney the codewitch6-Dec-19 13:06 
GeneralRe: I'm completely stumped. At least for now. Pin
englebart9-Dec-19 5:39
professionalenglebart9-Dec-19 5:39 
Having one object take and action based on the type of another object is usually an anit-pattern. It typically ends up with a bunch of if else statements or even a switch/case statement in some languages: maintenance nightmare for the future.

The answer you seek might be figured out by asking the object itself for the answer, or just telling it to do something.

var answer = this.TellMeWhatINeedToKnow(...);

or

this.DoWhatIsRightForYourType(...); // I Don't Care How You Accomplish It

You might have to support an interface for this to work, or use some other technique like reflection to see if the method is implemented. Does C# support friend methods like C++?

GeneralRe: I'm completely stumped. At least for now. Pin
honey the codewitch9-Dec-19 5:47
mvahoney the codewitch9-Dec-19 5:47 
QuestionWhy use .NET technologies vs., say, Node? Pin
Marc Clifton6-Dec-19 4:03
communityengineerMarc Clifton6-Dec-19 4:03 
AnswerRe: Why use .NET technologies vs., say, Node? PinPopular
Pete O'Hanlon6-Dec-19 4:05
communityengineerPete O'Hanlon6-Dec-19 4:05 
GeneralRe: Why use .NET technologies vs., say, Node? Pin
#realJSOP6-Dec-19 5:06
mva#realJSOP6-Dec-19 5:06 
GeneralRe: Why use .NET technologies vs., say, Node? Pin
Fernando A. Gomez F.9-Dec-19 9:43
MemberFernando A. Gomez F.9-Dec-19 9:43 
GeneralRe: Why use .NET technologies vs., say, Node? Pin
#realJSOP9-Dec-19 11:34
mva#realJSOP9-Dec-19 11:34 
GeneralRe: Why use .NET technologies vs., say, Node? Pin
Dan Neely6-Dec-19 5:41
MemberDan Neely6-Dec-19 5:41 
GeneralRe: Why use .NET technologies vs., say, Node? Pin
Pete O'Hanlon6-Dec-19 6:18
communityengineerPete O'Hanlon6-Dec-19 6:18 
GeneralRe: Why use .NET technologies vs., say, Node? Pin
Dan Neely6-Dec-19 6:26
MemberDan Neely6-Dec-19 6:26 
GeneralRe: Why use .NET technologies vs., say, Node? Pin
Marc Clifton6-Dec-19 7:59
communityengineerMarc Clifton6-Dec-19 7:59 
GeneralRe: Why use .NET technologies vs., say, Node? Pin
Idaho Edokpayi11-Dec-19 9:03
MemberIdaho Edokpayi11-Dec-19 9:03 
GeneralRe: Why use .NET technologies vs., say, Node? Pin
Marc Clifton6-Dec-19 8:17
communityengineerMarc Clifton6-Dec-19 8:17 
GeneralRe: Why use .NET technologies vs., say, Node? Pin
Pete O'Hanlon8-Dec-19 21:39
communityengineerPete O'Hanlon8-Dec-19 21:39 
AnswerRe: Why use .NET technologies vs., say, Node? PinPopular
F-ES Sitecore6-Dec-19 4:15
mveF-ES Sitecore6-Dec-19 4:15 
GeneralRe: Why use .NET technologies vs., say, Node? Pin
PIEBALDconsult6-Dec-19 4:21
professionalPIEBALDconsult6-Dec-19 4:21 
GeneralRe: Why use .NET technologies vs., say, Node? Pin
harold aptroot6-Dec-19 4:22
Memberharold aptroot6-Dec-19 4:22 
AnswerRe: Why use .NET technologies vs., say, Node? Pin
PIEBALDconsult6-Dec-19 4:27
professionalPIEBALDconsult6-Dec-19 4:27 

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.