> Unfortunately this initial simplicity introduces unexpected complexity, things like deep dup and deep merge are now needed.
Not if your data structures are immutable, which is exactly what he is advocating.
Not if your data structures are immutable, which is exactly what he is advocating.
I think my other point still stands, things like optional keys, or missing or required keys still must be shared throughout the app. Everything that touches that hash needs to know its structure.
And in case you want some security you can use libraries like prismatic/schema, that allow you to declaratively describe your expected data-structures akin to a type system.
The web is build on json and not corba because plain maps and vectors are far easier to work with than domain specific objects.
There’s tradeoffs. Shallow datastructures are under-used.
But OOP objects share fundamental flaws with deep hashes. (And add some more.)