Math Is Fun Forum
  Discussion about math, puzzles, games and fun.   Useful symbols: √ ∞ ≠ ≤ ≥ ≈ ⇒ ∈ Δ θ ∴ ∑ ∫ π -

Login

Username

Password

Not registered yet?

#1 2013-07-28 00:48:17

Agnishom
Real Member
Award: Wink Sherlock

Offline

The Zen of Python, by Tim Peters

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!

When you type import this in the python interpreter, you get this


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'Who are you to judge everything?' -Alokananda

#2 2013-07-28 00:52:47

bobbym
Administrator

Online

Re: The Zen of Python, by Tim Peters

Hi;

Do you like his restrictions?


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

#3 2013-07-28 13:40:25

Agnishom
Real Member
Award: Wink Sherlock

Offline

Re: The Zen of Python, by Tim Peters

They are not restrictions


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'Who are you to judge everything?' -Alokananda

#4 2013-07-28 14:30:46

bobbym
Administrator

Online

Re: The Zen of Python, by Tim Peters

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.

Here is the 2 I mean.


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

#5 2013-07-28 18:14:11

Agnishom
Real Member
Award: Wink Sherlock

Offline

Re: The Zen of Python, by Tim Peters

Yes. Someone at stackoverflow said that the line

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

reffers to the

Code:

for i in xrange(n):
...

style loops


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'Who are you to judge everything?' -Alokananda

#6 2013-07-28 18:18:54

bobbym
Administrator

Online

Re: The Zen of Python, by Tim Peters

Hmmm, I am not sure that I agree with him but maybe for that small type of problem he might be right.

For the other one, I heartedly disagree. The ansatz should be the mainstay of every problem solvers math.


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

Board footer

Powered by FluxBB