태터데스크 관리자

도움말
닫기
적용하기   첫페이지 만들기

태터데스크 메시지

저장하였습니다.

초보 리눅서의 이야기

Zen of Python

프로그래밍 l 2008.05.11 21:14
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!

파이썬의 설계 원칙과 철학을 담고 있는 Zen of Python입니다.
파이썬이라는 언어를 이해하고 사용하는 데 도움이 될 수 있을 것 같습니다.

특히, "There should be one-- AND preferably ONLY one --OBVIOUS way TO do it."이라는 파이썬의 철학은 펄의 모토인 "There is more than one way to do it."과 정반대라는 점이 재미있습니다. :-)

Zen of Python은 파이썬 인터렉티브 모드에서 import this라고 입력하면 볼 수 있습니다.

jeongsw@jeongsw-desktop:~$ python
Python 2.5.2 (r252:60911, Apr 21 2008, 11:12:42)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import this
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!
>>>


신고
크리에이티브 커먼즈 라이선스
Creative Commons License

'프로그래밍' 카테고리의 다른 글

me2DAY Shortcut 0.2  (0) 2008.05.16
Google Keyboard Shortcuts  (2) 2008.05.15
Zen of Python  (0) 2008.05.11
me2DAY Shortcut  (8) 2008.05.10
JZip 0.9  (6) 2008.04.14
간단한 DAYTIME 서비스 프로그램  (4) 2008.04.12

1 ··· 30 31 32 33 34 35 36 37 38 ··· 440 
BLOG main image
초보 리눅서의 이야기
초보 리눅서의 프로그래밍 이야기
by 초보 리눅서

카테고리

분류 전체보기 (440)
프로그래밍 (29)
Emacs (16)
Linux (109)
프로그램 (209)
기타 (77)
tistory!get rss Tistory Tistory 가입하기!

티스토리 툴바