J
Jon Skeet [C# MVP]
Martin Z said:Too bad DotNet exceptions are so cumbersome (heavyweight, difficult to
mask out in debugger) or I'd just suggest doing the Pythonesque
approach of "just do it and catch the exception"... well, that and the
fact that a NullReferenceException could also come from the actual
events being called, the hiding of which would be a Very Bad Thing....
any handling logic to try and discern what object was null that threw
the exception would have the same threading problems as the original
plan...
It would be a complete abuse of exceptions, IMO. Not having any
subscribers is *not* an exceptional situation for an event.
(As for the "heaviness" of .NET exceptions - if you mean in terms of
performance, you might like to read
http://www.pobox.com/~skeet/csharp/exceptions.html - it's a pet topic
of mine
