
Ask HN: What's your opinion, implicit vs. explicit? - RUG3Y
The Zen of Python states &quot;Explicit is better than implicit.&quot;<p>In [this article](http:&#x2F;&#x2F;www.paulgraham.com&#x2F;popular.html), PG states that &quot;Anything that can be implicit, should be.&quot; The context is about the brevity of code.<p>In general, I&#x27;m a fan of brevity, but I also dislike overly complicated code - by that I mean, code that is difficult to read. I&#x27;d like to hear opinions and ideas about how you balance these opposing ideas when you&#x27;re writing code. My personal context is the Python language.
======
KZeillmann
Code is read much more often than it is written. I'll take something verbose
and explicit over something magical and brief any day of the week. It's why
I'm preferring Elixir to Ruby for any side projects. Elixir is so explicit
about how everything works. There's little magic happening behind the scenes.

------
mindcrime
Explicit, explicit, explicit. I'll take readability over brevity any day (and
twice on Sundays) and I believe relying on implicit behavior and various forms
of "black magic" hurts readability. Saving a few keystrokes for the sake of
saving keystrokes is a false economy if it makes the code harder to read for
the next poor sap who comes along and has to read it (which, guess what, may
be the poor sap who wrote it in the first place!).

~~~
RUG3Y
I agree with you, but I'm currently dealing with a Python codebase that is
very verbose and is written in classes with 5 - 6 levels of inheritance - it's
a nightmare. This type of code organization couldn't be considered "explicit",
could it?

~~~
makecheck
"Explicit" isn't necessarily "verbose", just clearer. Sometimes this means
bubbling more details to the top in the same amount of code, like taking
surprising side effects out of a complex function and calling them more
directly.

~~~
RUG3Y
Thanks for sharing your thoughts.

