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!
>>>
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!
>>>
'프로그래밍' 카테고리의 다른 글
| me2DAY Shortcut 0.2 (0) | 2008/05/16 |
|---|---|
| Google Keyboard Shortcuts (0) | 2008/05/15 |
| Zen of Python (0) | 2008/05/11 |
| me2DAY Shortcut (6) | 2008/05/10 |
| JZip 0.9 (4) | 2008/04/14 |
| 간단한 DAYTIME 서비스 프로그램 (2) | 2008/04/12 |




