This question got me thinking: should we apply the principle that \"flat is better than nested\" to data as well as to code? Even when there is a \"logical tree structure\" to t
should we apply the principle that "flat is better than nested" to data as well as to code?
No.
Even when there is a "logical tree structure" to the data?
That's what "flat is better than nested" doesn't apply to data. Only to code.
... the tree structure is obscured. Does that contradict "explicit is better than implicit"?
It's not even comparable. The "flat tree" is a common SQL implementation because SQL can't handle indefinite recursion of a proper tree.
Comparing the Zen of Python (the language) with data structure design is nonsensical. The two are no more comparable than than the number "2" and splitting a brick of cheese into "2" pieces. One's a thing, the other's an action.
Data structures are things.
Python describes actions.