Continuing the discussion from Nested Hashes and Arrays:
We are kind of getting away from the subject a bit, so I’m breaking this off to a “Struct-like” discussion thread.
I had to go look up
Struct again because I always avoid using it, and never suggest it. I needed to refresh my memory as to why.
Otherwise, the name of this struct will appear as a constant in class
Struct, so it must be unique for all
Structs in the system …
This means my
Window struct can clash with Nat’s.
It not that it is a limitation, because it an be avoided by omitting a first String argument, but the potential for creating clashing constants by newbs is so great, that I’d only recommend it to more advanced coders.
But remember that Struct is just a factory class that generates data classes. By the time a coder is experienced enough to understand proper use of Struct in a shared environment, they’re talented enough to write their own wrapper or factory classes themselves.