Simple design is zen

Dan North (a.k.a. the BDD guy) tweets:

SOLID is well known Object-Oriented Design principles, Uncle Bob introduced this acronym in his book. If someone ask you about design principles in a technical interview, this probably is the most sound answer. But I totally get Dan’s point, those acronym is cool but hard to apply in practice. I mean everyone who is good at code know what is good design, and those principles does apply well. But in most of time, this is like a review of stock market. It make sense, but you can’t use the review to predict the market. I feel they are confirmation bias.

Please take a look on Dan’s deck “Why Every Element of SOLID is Wrong”, it’s humorous. His point is “Write Simple Code”, which I dig. This is a way to say don’t trust prediction of stock market, use your common sense. It’s not because any simple code is good code, it is just saying that you should “Chop Wood Carry Water”.

The goal of Zen, his master taught him, was to “archive a void … noiseless, colorless, heatless void” – to get to that state of emptiness, whether it was on the mound or in the batter’s box or at practice.

Before that, Zhuang Zhou, the Chinese philosopher, said, “Tao is in the emptiness. Emptiness is the fast of the mind.”

Quote from the book Stillness Is the Key

I feel the “Write Simple Code” tag line is in the spirit of zen. Always want to apply best practice, design principles feels like ego. We have an impression those pattern matching process make perfect code. But the order is wrong. We can refactor code to use patterns, but pay upfront cost to use pattern may be a waste. If we can put down our ego, we can just go back to our emptiness and write simple code. Make It Work Make It Right Make It Fast. Go back to basic, Chop Wood, Carry Water, Chop Wood, Chary Water.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.