Skip to content

Latest commit

 

History

History
19 lines (10 loc) · 1.12 KB

zen-of-python.md

File metadata and controls

19 lines (10 loc) · 1.12 KB

Beautiful is better than ugly. I like to read code that is beautiful and easy; Python allows me to create an easy-to-read code.

Explicit is better than implicit. The code has to be perfectly explained.

Simple is better than complex. As Einstein once said: "If you can’t explain an idea to a 10 year old you don't understand the idea."

Complex is better than complicated. You can make complex code, but complicated code is difficult to maintain.

Flat is better than nested. This is self-explanatory.

Sparse is better than dense. Less code, better work.

Readability counts. Other people have to read your code and understand it. This is very important when the code is created by one person and maintained by others.

Special cases aren't special enough to break the rules. Don’t break the rules. Please!

Although practicality beats purity. Only if it is an extreme case, one in which the rule is interrupting your work, can you break it.

Errors should never pass silently. Errors are like a disease: if they pass silently, they have more power. It is necessary to have a very good error detector.