Live your life by the Tao of Python
As a Godless heathen, I have no scripture from which to guide me in my day-to-day life, and I must look for meaning elsewhere. I believe I have found that meaning in the most unlikely of places; the Python shell. If you enter
import this in to the Python interpreter, it will reveal to you an ancient wisdom in the guise of a collection guidelines for the Python language.
>>> import this 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!
I have studied these words for many years and have come to believe that they are in fact guidelines for living a fulfilling and successful life.
Beautiful is better than ugly.
As the first line in the Tao, this line must surely possess some special significance. The obvious interpretation would be to seek out that which is beautiful and reject that is ugly – but as anyone with experience of life knows, beauty does not always bring happiness. A deeper meaning must be sought.
I suspect that Beautiful is actually a mis-translation of Elegance, and ugly refers to the literal opposite of elegance. Elegance of course, can refer to many things that are harmonious together. Given these corrections, the meaning is clear; do not seek out the most beautiful woman, or the most beautiful car – they will not bring happiness. Seek out a woman and a car that possess elegance (not just beauty). The Tao brings us wise words indeed.
Explicit is better than implicit.
The Tao teaches us that it is better to be explicit in all things. A truism that can be found in religion: “Don’t hide your light under a bushel”, and conventional wisdom: “Don't ask, Don't get”. Although the Tao is true to its own words, and need not talk in allegories of bushels and lights. Explicit means being direct and not hiding ones intentions. If you want to leave with the most elegant woman, be direct.
Simple is better than complex.
In a world that seems to get more complex every year, the Tao tells us to prefer simplicity. Hows can this be so? Think back to when you were most happy and you will likely recall the time when things were most simple; most likely your childhood. Truly, simple brings happiness. Trust the Tao.
Complex is better than complicated.
The Tao recognizes that the cosmos is an imperfect place, and even though one may favor simplicity, complexity may still arise. The Tao also suggests that although complexity may be unavoidable, we often bring complicated upon ourselves. To elucidate; a girlfriend may be complex, but two girlfriends are complicated.
Flat is better than nested.
In life, there are many goals and tasks required to accomplish those goals. If we nest out task, that is start another task before fully accomplishing what we have started, then we will struggle to accomplish anything. The Tao tells us that it is better to be flat, and to fully achieve each goal before moving on to the next.
Unfortunately, I can't divulge the rest of the secrets in the Tao, as to truly understand Tao, one must study it. I myself have yet to decipher it's full meaning, and some of it seems puzzling even to me; the Tao appears to indicate that only the Dutch can achieve true enlightenment.
Best of luck on your own quest for enlightenment, and remember: blessed are the geek, for they shall inherit the Earth.
It's true that by looking at Python code, you can guess some details about the author of the lines, and appreciate how close he is from the way…
“If you want to leave with the most elegant woman, be direct.”.replace(“leave”, “live”)
This is a beautiful post. Thank you, Juan