DRMacIver's Notebook

Implicit vs Explicit

Implicit vs Explicit

The Zen of Python:

The only one of these people seem to remember is "explicit is better than implicit". Unfortunately, it falls afoul of the problem that almost all "X is better than Y" advice has, which is that the important qualification "All else being equal" is left, well, implicit.

Explicit is more verbose than implicit. Explicit is more expensive than implicit. If you try to make everything explicit then you will never get anything done, because as with everything, being explicit has costs as well as benefits. Explicit may be better than implicit, but implicit is cheaper than explicit. Everything is a trade-off.

It can be worth adjusting where you are in trade off space though - just because everything is a trade off doesn't mean you're automatically in the right region of trade off space, and it's much easier to err in the direction of making things too explicit rather than too implicit.

Tying into past posts: