“In the face of ambiguity, refuse the temptation to guess.”
Guido van Rossum shared a remembrance of Tim Peters, an important member of the Python community, who passed away earlier this year.
I do not use Python all that much, and I wasn’t familiar with Peters’s work, but among his accomplishments was the Zen of Python, which consisted of 19 principles:
- 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!
(The links come from Wikipedia’s version. I kept them because they provide nice context for non-programmers.)
I have always been wary of design principles. Most fall pretty to the classic saying “Everything simple is false. Everything complex is unusable.” I find the vague ones uninspiring, and the specific ones too rigid to be useful – a lot of design sooner or later arrives at “it depends,” and that’s hard to capture in a pithy one-liner.
But there is something about (some of) these above that feels different, and Wikipedia entry suggests people actually found them useful. Perhaps they’re more pragmatic than usual, many expressed as “X over Y,” rather than fluffy stuff like “Move fast and break things” (evil), “Make it as simple as possible, but not simpler” (easy to abuse), or “Design is not how it looks, it’s how it works” (a perversion of Jobs’s “Design is not just what it looks like and feels like. Design is how it works.”) Or maybe they’re as bad and I see them as interesting only because they’re exotic, coming from the coding realm rather than the design one?
Either way, they made me think what my own design principles would be. I arrived at a few of the first kind…
- 1fps or 60fps, but nothing in between.
- True UX delight is fiber, not sugar.
- Design assuming your every user will become a power user.
- You can ignore motor memory, but motor memory will never ignore you.
…but I have to think about this all more carefully. Maybe more importantly, I’m interested in principles of those principles. Should each principle have a solid example showing you exactly how it’s been helpful before? You can sense there’s a real war story behind “Now is better than never. Although never is often better than right now.” and it would be great to read it.
This is a thread in progress and I will report back. In the meantime, maybe Peters’s list would be useful for you to think about your list, too?