Life Lessons from “The Zen of Python”
Change your mindset for living a simple, beautiful life

While coding the classic snake game on Python, I talked to my husband that I need to rehearse more by taking challenges on HackerRank. As my husband knows that I am saying it for several months, he asked whether I know the Zen of Python? I googled quickly and found the Zen of Python. He asked for me to read it aloud. I read it aloud with a dramatic voice. When I reached this line Now is better than never, I understood why he asked me to read it aloud. Do not procrastinate, do it right now was the message of my husband. Thanks to my husband that reminded me of it. As not only that line but also all other lines of the Zen of Python can teach us a life lesson.
I want to confess that I had read the Zen of Python almost a year ago and forgot. But today, I see it from a different perspective. Or who has a hammer at hand, sees everything as a nail, as I see an opportunity in every topic to write.
Firstly, let us learn the meaning of the Zen word. According to the Merriam-Webster dictionary, Zen’s meaning comes from a Japanese sect of Mahayana Buddhism that aims at enlightenment by direct intuition through meditation. As an adjective, it means “having or showing qualities (such as meditative calmness and an attitude of acceptance) popularly associated with practitioners of Zen Buddhism.”
Beautiful is better than ugly.
Life blossoms in our hearts while we see the beauty in the mud. Life is precious when we add value to it. Why not find the beauty in everything and make our life more valuable? It is in our hands to open our palms and let the butterfly fly. Even if a butterfly lives only a year, live beautifully. Live your lives like a butterfly. And make others get the opportunity to live a beautiful life.
Explicit is better than implicit.
Life is more beautiful when people understand each other. Understanding each other is happening through communication. The communication is understandable when we express explicitly. Time is precious. What you want to say, say it without vagueness, leaving no question as to meaning or intent. Do not put a place for misunderstanding.
Simple is better than complex.
If you can make it simple, do it. There is no need to make something complex if there is a way to make it simple. Doing something complex does not mean we are not geniuses. The opposite is true.
Complex is better than complicated.
If you can not make it simple, the complex is good unless it is complicated. Life is short, and there is no need to make it knotty. A simple one is the best, a complex one is better, and a complicated one is the worst.
Flat is better than nested.
Sometimes we make other people responsible for our mistakes or unfortunates. Instead of that, we can deal with each of our mistakes. And take responsibility for the way we are dealing with them.
Sparse is better than dense.
Sometimes we load our shoulders with the loads more than we carry. It is like making a list of New Year resolutions. After 15th January, we burn out and lose our motivation. Instead of that, we can make small batches to reach our goals, rather than doing them in one go.
Readability counts.
I afraid of being misunderstood from the outside. To mitigate such kind of situation, expressing yourself is crucial. Moreover, if your deeds and actions are overlapping, it means you are doing well on it.
Special cases aren’t special enough to break the rules.
Do the opposite. Never put yourselves into the cages. The rules are good, but breaking them better if necessary. Life is not so long to spare it within the walls.
Although practicality beats purity.
This line supports my thoughts above. Do not perceive this wrong. If breaking rules bring welfare not only to you but also to outsiders, consider it. Never forget that the borders of your freedom stop at the others.
Errors should never pass silently.
Never sweep your mistakes under the carpet. Be honest with yourselves. Accept them and think about how to deal with them. Take responsibility to deal with them.
Unless explicitly silenced.
Sometimes you can encounter errors that you have not any power to deal with it. Then leave it. Never take it as a load to your shoulders if it is not in your capacity.
In the face of ambiguity, refuse the temptation to guess.
Guessing is like a gamble. You would not like to surrender your life to gambling. You can guess something true, but it does not mean that you will be lucky in every guess. Do not live with the assumptions.
There should be one — and preferably only one — obvious way to do it.
At any step of life, we can encounter various challenges. We can feel disappointed and exhausted. But never forget that even in the best difficult situation, there can be a light of hope. Never lose it. That hope can be your beacon.
Although that way may not be obvious at first unless you’re Dutch.
There can be times you can not find your way. Never give up, get your muscles strong, make your hands dirty. You will find your right way even it is not apparent to you at first.
Now is better than never.
This line is the message that my husband mentioned to me. Want to do something? Act on it now, never postpone it for a later date like me. Do not be like me.
Although never is often better than *right* now.
But do not hurry. Before intending to do it, consider putting some thought into it. If you invest your valuable time in something, spare a little time for research. But do not lose yourselves in analysis paralysis.
If the implementation is hard to explain, it’s a bad idea.
This line is something like if you can not explain it in plain words, it means you have not understood it yet.
If the implementation is easy to explain, it may be a good idea.
Vice versa is true. If you can explain it step by step and in a clear way, you are on top of that.
Namespaces are one honking great idea — let’s do more of those!
Take responsibility for your life and do not intervene in other people’s areas unless asking for advice and assistance.
Note:
If you want to read about the meaning of the Zen of Python from the programmer’s point of view, you can read the A Brief Analysis of “The Zen of Python” by Jonathan Michael Hammon.
The Zen of Python, by Tim Peters
Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren’t special enough to break the rules. Although practicality beats purity. Errors should never pass silently. Unless explicitly silenced. In the face of ambiguity, refuse the temptation to guess. There should be one — and preferably only one — obvious way to do it. Although that way may not be obvious at first unless you’re Dutch. Now is better than never. Although never is often better than *right* now. If the implementation is hard to explain, it’s a bad idea. If the implementation is easy to explain, it may be a good idea. Namespaces are one honking great idea — let’s do more of those!
REFERENCES:
The Zen of Python, by Tim Peters
A Brief Analysis of “The Zen of Python” by Jonathan Michael Hammon






