Wednesday, May 14, 2014

Calling a CLICK METHOD from another method!

You know what I hate? When a developer decides to call a btn_Click method from another method. I mean, seriously, what the fuck? I work with a lot of older applications and many of them weren't written well. I think putting a btn_click method in the Form_Load spells "code being on the verge of unmaintainability" because all kinds of crazy shit happens.

For example, I'd show FormA, which would run the Load method of FormA. That Load method would run a click event that starts FormB. So the next thing I see in the GUI is FormB, not FormA! I was like, "WTF! I did NOT show that form! Madness!!!"

Click events planted in other methods (or EVENTS) are like planting bombs. They will go off with a bang if you do not disarm them.

No comments:

Post a Comment