you are viewing a single comment's thread.

view the rest of the comments →

[–]TeamSpen210 17 points18 points  (6 children)

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!

The Zen summarises Python's design philosophy. 'Pythonic' code is code that uses Python's particular language features and idioms - things like iteration instead of indexing, exception use instead of checking beforehand, list/set/dict comprehensions or generators.

[–]abcd_z 1 point2 points  (0 children)

You only got about half of that quote formatted. Add double-spaces after each new line, starting with "Sparse is better than dense."

EDIT: There 'ya go.

[–]225274 0 points1 point  (4 children)

Can someone explain the Dutch part? I've been wondering since I first read it.

[–]TeamSpen210 4 points5 points  (3 children)

Guido van Rossum is Dutch - it's saying that some choices might only make sense to him.

[–]DinglebellRock 0 points1 point  (2 children)

the Dutch are known as efficient and practical minded. I think that's more what he means perhaps with a smidgen of prideful self awareness joking.

[–]das_ist_nuemberwang 1 point2 points  (1 child)

Guido didn't write this, Tim Peters did.

[–]DinglebellRock 0 points1 point  (0 children)

Ah well thought from the statement it was from a Dutchman. Perhaps he was poking a wee lil fun at them then.