少于 1 分钟阅读

今天看了传说中的Zen of Python(Python之禅)。。。太有哲理了😄。

我试着用自己的言语翻译一下:

  1. Beautiful is better than ugly.

    美比丑好。

  2. Explicit is better than implicit.

    清晰优于晦涩。

  3. Simple is better than complex.

    简介优于复杂。

  4. Complex is better than complicated.

    复杂优于繁杂。

  5. Flat is better than nested.

    平铺直叙优于绕圈。

  6. Sparse is better than dense.

    松弛比密集好。

  7. Readability counts.

    要有可读性。

  8. Special cases aren’t special enough to break the rules.

    特例也不违背原则。

  9. Although practicality beats purity.

    但完美要让步于实用。

  10. Errors should never pass silently.

    面对错误不能选择沉默。

  11. Unless explicitly silenced.

    除非明确被要求沉默。

  12. In the face of ambiguity, refuse the temptation to guess.

    不明白时别乱猜。

  13. There should be one– and preferably only one –obvious way to do it.

    有且应该只有一个明显的答案。(暗指前面乱猜大概率是错的)

  14. Although that way may not be obvious at first unless you’re Dutch.

    尽管这个明显的答案一开始并不明显,除非你是那个荷兰人。(python语言的作者是荷兰人)

  15. Now is better than never.

    马上行动比啥也不做好。

  16. Although never is often better than right now.

    尽管不行动常常比不需要行动的时候却去行动更好。

  17. If the implementation is hard to explain, it’s a bad idea.

    解释不清的计划,是个馊主意。

  18. If the implementation is easy to explain, it may be a good idea.

    很容易就能理解的计划,往往是个好主意。

  19. Namespaces are one honking great idea – let’s do more of those!

    命名空间是个很棒的思路,我们要多多使用它。

</br> Python之禅

留下评论