The Zen of Python

Over the last two weeks, I’ve been working on redesigning the website so that it’s easier to navigate and more pleasing to the eye. As usual, my first step was to investigate the topic, so off I went to Google, looking for sites that could teach me about basic website design fundamentals, as well as how to write a successful blog. Here’s the thing: many of the sites I visited didn’t look good and were poorly written. I don't have anything  against people offering advice, but I do have a bone to pick when a site that purports to provide website design expertise or blogging advice is itself poorly designed and poorly written.

So I thought this might be a good time to review “The Zen of Python” written by Tim Peters. It's a list of aphorisms about writing computer code. For those of you who don’t know Python, it’s a programming language that was designed for clarity. Whether or not you are interested in programming, the ideas can be applied to any design process, especially writing and teaching. (Yes, I do think that writing and teaching are design processes. I will write a post about this later.)

You can find the webpage here.

The Zen of Python

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!

Show Comments