Celestial Emporium of Benevolent Knowledge
Previous: Saving the journalism. With bitcoin.
Programmer! Every time you are about to create a class hierarchy stop for a while and recall this taxonomy of animals in the ancient Chinese encyclopaedia called 'Celestial Emporium of Benevolent Knowledge':
- Those that belong to the emperor
- Embalmed ones
- Those that are trained
- Suckling pigs
- Mermaids (or Sirens)
- Fabulous ones
- Stray dogs
- Those that are included in this classification
- Those that tremble as if they were mad
- Innumerable ones
- Those drawn with a very fine camel hair brush
- Et cetera
- Those that have just broken a carafe
- Those that, at a distance, resemble flies
Source: Jorge Luis Borges, El idioma analítico de John Wilkins.
Comment: Although this parody was written in mid XX. century, the impracticality of hierarchical organisation of concepts was pointed out in XVII. century, in Wilkins' own time, by no one less than Gottfried Leibniz. Despite of that, the idea re-emerged and gained popularity in late XX. century with the advent of so called "object-oriented design".
Martin Sústrik, October 5th, 2015
Previous: Saving the journalism. With bitcoin.
inb4 traits.
kudos
Hmm, no, OOPS isn't about taxonomy.
It's about class invariants.
ie. Constraints on the state space of the instance variable.
And the Liskov Substitution Principle is really just saying you can use inheritance if and only if child classes state space is a subspace of the parents.
Post preview:
Close preview