Event-driven Programming - Criticism and Best Practice

Criticism and Best Practice

Event-driven programming is widely used in graphical user interfaces because it has been adopted by most commercial widget toolkits as the model for interaction. The design of those toolkits has been criticized for promoting an over-simplified model of event-action, leading programmers to create error prone, difficult to extend and excessively complex application code:

Such an approach is fertile ground for bugs for at least two reasons:

  1. It can lead to writing code within the event handler for each possible value of various values in the program, making the source code hard to understand.
  2. In places where the event code changes variables shared throughout the program, it can require the programmer to write convoluted algorithms to avoid unwanted ripple effects.

Read more about this topic:  Event-driven Programming

Famous quotes containing the words criticism and/or practice:

    I, with other Americans, have perhaps unduly resented the stream of criticism of American life ... more particularly have I resented the sneers at Main Street. For I have known that in the cottages that lay behind the street rested the strength of our national character.
    Herbert Hoover (1874–1964)

    In the case of all other sciences, arts, skills, and crafts, everyone is convinced that a complex and laborious programme of learning and practice is necessary for competence. Yet when it comes to philosophy, there seems to be a currently prevailing prejudice to the effect that, although not everyone who has eyes and fingers, and is given leather and last, is at once in a position to make shoes, everyone nevertheless immediately understands how to philosophize.
    Georg Wilhelm Friedrich Hegel (1770–1831)