It seems every language has it's own way of implementing callbacks.
Back in the VB days (daze?) we used the addressof operator and all kinds of win32 stuff to get app and activex control to do what we wanted.
In C#, we have the delegate (and the anonymous delegate) that makes life pretty easy in terms of defining how to subscribe to a callback "even" and how to broadcast that callback.
Why do we need it?
Think of the way code normal iterates from line to line. It's straightforward and simple: you loop over a list, and at the end of the loop, you keep going; you use an if statement, and after that you know that the condition has been met; similarily, when you call a method, you know that it has done all of its work and returned something useful. Right? Well. not always. Sometimes that method will invoke web requests that need some time to process, or it may call another method that has to do some processing or is waiting for
View Complete Post