Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the meaning of Python's philosophy "never is often better than *right* now" [closed]

Tags:

I don't quite understand the second sentence here from The Zen of Python:

Now is better than never.
Although never is often better than right now.

Can anyone explain it or give an example?

like image 510
lcltj Avatar asked Dec 11 '13 23:12

lcltj


People also ask

What is the philosophy of Python?

The minimalistic design philosophy of Python means that it emphasizes code readability. It also provides a syntax structure that allows programmers to express concepts in fewer lines of code than in languages such as C++ and Java. Moreover, Python provides the means to write programs that can be scaled up easily.

Who wrote the Zen of Python?

The Zen of Python is a collection of 19 "guiding principles" for writing computer programs that influence the design of the Python programming language. Software engineer Tim Peters wrote this set of principles and posted it on the Python mailing list in 1999.

How do I read a Zen file in Python?

Thanks to his contribution, anyone can view the Zen straight from the Python interpreter by typing import this : >>> import this The Zen of Python, by Tim Peters Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex.


2 Answers

It is a two parter:

Now is better than never

Don't spend too much time planning and pre-optimising; get something down that does the job and iterate on it (or: fix that issue now rather than putting it off).

Never is often better than right now

But do put some thought into it, so you don't head off down a path that later means there's no graceful way back (see also: YAGNI).

like image 107
jonrsharpe Avatar answered Sep 23 '22 03:09

jonrsharpe


I would imagine that the philosophy means that it is better to think of a solution rather than simply forestalling the inevitable (and causing problems later).

However, it is also better to think about what solution you will do first - don't write 'quick hacks' to solve the problem at hand.

So, It's best to fix that problem sooner rather than later, but don't immediately code whatever comes to mind, instead, think about that first and what ramifications your fix might have.

like image 37
Singular1ty Avatar answered Sep 24 '22 03:09

Singular1ty