Wednesday, May 16, 2007

What is the difference between an event and a multicast delegate?

I was asked this question recently.
I was aware to the fact event differs from a "normal" delegate since it is a multicast delegate.
I may have looked further into it in the past, but when asked I couldn't recall how those two differ, especially since I always used events, so I assumed event is just a "syntactic sugar" for a multicast delegate.
As it turns out, I was wrong, and events are wrappers around multicast delegates.

Start rant:
I don't like questions with the structure of "list the differences between X and Y".
When you ask someone with experience (as oppose to a textbook), you should ask "given scenarios A and B, would you use X or Y, and why?".
End rant.

No comments: