Hi all,
Visual Basic was released in the 1990's and immediately became hugely popular in corporate America because its new Event Driven design allowed programmers to deliver huge financial value to organizations.
Event Driven is a key concept there, it seems to me.
I have a theory today, as follows, for Windows Forms 2.0:
THE VALUE OF AN EVENT TO A PROGRAMMER IS USUALLY INVERSELY RELATED TO THE NUMBER OF TIMES IT FIRES.
For example, if, when a Form opens, its form_load event fires once and only once, that is a good thing for a programmer. But if it fires twice, then the event is not so useful. If it fires 6 or 7 or maybe 10 times every time the form is opened, then its value is even less. Thank goodness, in Windows Forms 2.0, the form_load event still fires once and only once.
But next, take for example a ComboBox's SelectedIndexChanged Event.
If, when we bind a form for example, the ComboBox's SelectedIndexChanged Event fires once, and only once, then it can be very valuable to a programmer. But if it fires twice, at unpredictable points, its value to a programmer is greatly diminished, it seems to me. And if it fires, 3 or 4, or maybe 7 or 8 times, unpredictably, its even more useless. Unfortunately, in Windows Forms 2.0, the SelectedIndexChanged fires multiple times, somewhat unpredictably to boot.
Or take for example a simple button click. Hopefully, we programmers are confident that whatever code we put in a button's click event will only be processed once, and only once, when the user clicks the button. What if the button_click event fired not once, but 2 or 3, or maybe a dozen times, and not just when the user clicked, but during form_load and binding Would we want to use it
This is only a theory of course. Can anybody see any weakness in this theory, or ways to state the theory more correctly
Any thoughts or ideas will be appreciated.