The smart button

I don’t always understand why people do things in some ways.

3 comments on “The smart button
  1. Purple-Bobby says:

    Rookie mistakes

  2. dragnucs says:

    What ways?

    • Kjetil Kilhavn says:

      The way shown in the code above, where one event handler seems to handle three (or two) buttons and even uses hardcoded text strings to identify the function to execute.
      Breaks if someone translates the UI, breaks if someone changes Quit to Close or Exit, and is not good separation of responsibility as it combines (in the same code block) starting/stopping something within the running application with application termination

Leave a Reply

Your email address will not be published. Required fields are marked *

*