Besides my technology interests, I’m a keen (if not necessarily good) student of martial arts, I practice Wing Chun and Jeet Kune Do 5-6 times a week, the first of them the martial art that Bruce Lee started out in, the latter the art he “invented”. My interest in Bruce Lee’s thinking is a biproduct of my interest in martial arts, rather than the other way around. But the mans thinking was certainly interesting, and in many ways groundbreaking in its time in the way that he brought together streams of ancient Chinese philosophy with modern thinking.
Expressing Software Design Patterns Are Like Forms in Martial Arts
I’ve found martial arts forms to be very much like Software Design patterns - a way of learning a specific style or structure by repetition of a particular form. Useful tools to learn, but once you get past the learning phase, ultimately limiting.
Bruce Lee viewed styles and forms in just this way - patterns and styles are useful learning tools, but once you master them, you must throw them away and forget them, or risk being limited by them. Lee emphasized having a “style with no style”.
I have come to view Design Patterns in much the same way: they are useful as learning crutches, but just like Bruce Lee viewed forms as akin to “learning to swim on dry land”, so too are design patterns as formally expressed mere crutches which often lack the dynamic context of a wider system of software. This is where you see many implementations go haywire: developers will apply design patterns they have learned left, right and centre, without consideration as to why they should apply them - you end up with something that looks like a pointless layered cake of design patterns that serves no actual purpose.
Natural Unnaturalness, or Unnatural Naturalness
The developer that has moved beyond mere design patterns, mere styles does not need to think about “now I’m doing a Decorator pattern” or whatever other pattern he is adding. He does not need to think expressly in terms of patterns, rather he instinctively finds the right solution for the problem and context at hand, just like the great fighter will instinctively apply the right response to an opponents attack based on a combination of instinct, training and experience. They both find the balance, to paraphrase Bruce Lee’s words, between instinct and science, between human being and “mechanical man”.
Being a student of many subjects, I have found some interesting synergies and commonalities emerge - Systems Thinking, Taoism, Chinese Martial Arts and Software Engineering are wildly different subjects, yet they have a surprising amount of areas of commonality. Design Patterns and Martial Arts forms/kata’s is one of them: they are useful learning aids, but once you have mastered them, you must throw them away and strive to find natural unnaturalness, a balance between instinct and formal science.