4 ms·
Explicit is better than implicit. Simple is better than complex.
by RyanMcGreal 13y ago
Explicit is better than implicit.
Simple is better than complex.
- nas 13y agoI'm not sure what that is supposed to mean in this context. Testing for "is not None" is more explicit and avoids the trap being discussed. I don't know how the second sentence applies, maybe "if timeval:" is simpler? BTW, do you know the original author of the Zen of Python has posted to this very dicussion (while also being the orginal author of said module): https://mail.python.org/pipermail/python-ideas/2014-March/026573.html https://mail.python.org/pipermail/python-ideas/2014-March/02... https://mail.python.org/pipermail/python-ideas/2014-March/026577.html https://mail.python.org/pipermail/python-ideas/2014-March/02...
- Pacabel 13y ago"Simplicity" is not measured in terms of key presses or characters. The "if timeval:" case may contain fewer characters, but it's less explicit. Being less explicit opens it up to greater ambiguity. Ambiguity is a form of complexity. Complexity is the opposite of simplicity. The explicit "is not None" check may require more typing, but it's far more explicit and exact. That means it's much less ambiguous, and thus less complex, and thus exhibits greater simplicity.
- freyrs3 13y agoThe word "simple" means many things to many people, it's probably the most ambiguous line in the Zen of Python.