All of these are "as long as not at huge expense to the others"; any would be bad on their own.
(in machine-learning-nerd terms, read these as a series of objective functions, and evaluate code based on these as something approximately like the sum of squared errors function. In non-machine-learning-nerd terms, one should try to minimize how much code breaks each of these rules individually. They are not priority sorted.)
-
Beautiful is better than ugly - while this is hopefully obvious, looking better is an acceptable thing to aim for.
-
Explicit is better than implicit - only delegate to implicit things that are sufficiently common to not be confusing.
-
Simple is better than complex - do make things implicit that will be obvious anyway.
-
Flat is better than nested - especially in directory structure and code depth; try to minimize indent.
-
Sparse is better than dense - don't be afraid of writing more stuff, as long as that stuff is semantically simpler. Don't try to pack it all in to the same spot.
-
Readability counts - the code has to be made and fixed by humans, even if just once.
-
Special cases aren't special enough to break the rules as often as your intuition says they are.
-
If they have to fight, practicality beats purity; avoid scenarios where you must choose one.
-
Errors should never pass silently - you can't fix it if you don't know it misbehaved.
-> it follows from this that misbehavior that can be detected before the program runs should be!
python violates this very badly. -
Unless explicitly silenced; some error states in one part of the code are not errors in the context of the whole.
-
In the face of ambiguity, refuse the temptation to guess.
-
There should be one - and preferably only one - obvious way to do it.
-
Now is better than never; don't try to make something perfect the first time.
-
Although never is often better than right now: yaks need not apply.
-
If the implementation is hard to explain, it's almost certainly a bad idea.
-
If the implementation is easy to explain, it isn't necessarily a bad idea.
-
Namespaces are a really great idea -- let's do more of those!