Search This Blog

Friday 15 July 2016

The Zen of Python

Long time Pythoneer Tim Peters succinctly channels the BDFL's guiding principles for Python's design into 20 aphorisms, only 19 of which have been written down.

I think these principles we can use in real life, aren't they?

  • 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!
FYI
In python command line just add this line of code:
>>>import this
And you will get all these principles... :-)

1 comment:

Anonymous said...

«Бенджамин Бриэль Ли всегда был очень профессионален, держал меня в курсе всего, что происходило. Если у меня были какие-либо вопросы, он всегда был готов ответить. Это была моя первая покупка дома, я мало что знал о процессе получения ссуды, он упростил понимание того, о чем у меня возникли вопросы. Мне очень понравилось работать с ним ».
Он кредитный специалист, работающий с группой инвесторов, которые готовы профинансировать любой проект или ссудить вам любую сумму с очень низким процентом. Свяжитесь с Бенджамином Бриелем Ли, электронная почта: 247officedept@gmail.com Номер Whats-App: + 1-989 -394-3740.