본문 바로가기

데이터과학/Python

[Python의 디자인 원리] 젠 오브 파이썬

반응형

<파이썬 로고 출처: 파이썬 공식 홈페이지>


파이썬 선()(Zen of Python)

아름다움이 추함보다 좋다.(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 idealet's do more of those!)


출처: 간결하고 생산성 높은 프로그래밍 언어 파이썬


반응형