Tuesday, July 26, 2016

Beyond design patterns

I came this morning across this issue posted on StackOverflow. The OP tries to build up a simple Tkinter GUI.

What is both funny and interesting to highlight is that the simplicity of the goals to fulfill became unexpectedly a little bit tricky or even complicated to fix because the OP relies on the MVC and Observer -the later one being often consequently a key component of the former-

The problem in itself can be resolved in 6 quick dirty lines of code on the fly.  I am not here to tell you design patterns are worthless,  but as a general rule of thumb I learned from my own experience, do not use them unless if really needed otherwise you would, probably, uselessly stumble in struggling to comply to them instead of effectively trying to implement the solution to the actual problem. Put it bluntly: be pragmatic!

As I deeply believe that the way we program reflects our state of mind, emotions,  personality and daily life attitude, I think one must wonder on the rule mentioned above especially by those who tend quickly and blindly to follow the mainstream way of thinking, believing or behaving without daring to put ahead their self confidence to think about what matters on their own.

This attitude would lead you to bear your own stuff, to develop your own design pattern and thus express better who you are through  dozens of thousands of apparently boring lines of code.