Matthieu Urvoy · @birozularutti
12 followers · 381 posts · Server piaille.fr

Let bob be an instance of class Bob.

Problem: how to run sequentially two simple methods of bob?

Solution 1:

* bob.method_1()
* bob.method_2()
* proudly exit

Solution 2:

* bob.method_1()
* signal main application that bob has run method_1
* use main application to signal everyone - including bob, that bob has run method_1
* bob: oh? I ran method_1, did I?
* then bob.method_2()

Note: signals are obviously homemade and not even thread safe.

#codequality #codeterrorism #programming

Last updated 1 year ago