I'm merging two projects one uses delegates for logging and the other uses events. Is one faster then the other and why? Or is there an advantage to using one over the other?
+1
A:
An event is a type of delegate, so I would not think you would see a major difference, as there is not a huge amount of overhead with an event. Depending on how you coded, you might see a small difference.
The advantage of one over another is more what paradigm you and your dev peeps are in. If it is easier to wrap your mind around events, then it is easier to maintain. I would not go for perf only, as you can end up with something your peeps cannot maintain, although the learning necessary to use a delegate only solution is worth it in my book.
Gregory A Beamer
2009-02-26 18:19:19
+1
A:
See this article for a good discussion on events vs. delegates. Also here is another good one.
Andrew Hare
2009-02-26 18:21:37