Why do we need it, when we've associative lists and hashtables?
my_hash["type_tag"] = "Dog".
And no OOP required.
Name:
Anonymous2011-03-26 15:57
Associative data structures have a fixed lookup cost... hashing that string and performing a linear or quadratic probe and string comparison on the underlying hash table nodes is more expensive than just reading from a static offset in memory that is known at compile time, which is the case with statically typed languages like C, C++, C#, or Java, etc.
In dynamically and duck typed languages like FIOC, FFOC (aka LUA), and so, class instance member lookups are implemented with associative data structures anyway, so it's no different than doing it manually.
Now, you might say "well, it's not that big deal on modern hardware," but then you're promoting everything that is wrong with modern software development, with the level of bloat and slowness found in today's software.