How Abstract is too Abstract

Abstraction creates freedom

I want my code to be free, so that it can go wherever it wants and participate in many other projects (anthropomorphically), beyond the project I designed it for. However, my code, being designed for a specific purpose, is good at doing something very specific, and if it's done right (in my opinion), it does that one thing, and does it well. So, how abstract should it be?

As abstract as one thing can be

It should be as astract as one thing can be. For example, if I am designing Elephants, then the ideal abstract element would still be an elephant. An Elephant It would have large ears, a trunk, two tusks, four legs, and a tail. I would find myself asking: do all elephants need tusks to be elephants? Can an Elephant have three legs? What happens if an elephant loses it's tail? Is it no longer an elephant? What is an elephant? What makes it meaningful? Why is an elephant an elephant? I guess that depends on the story (think Agile methodology).

The story dictates the level of abstraction

So, in a story about a man who comes back to his car to find an elephant has crushed it, the elephants importance is weight, size, and wildness. So, an ideal abstract elephant would be big and strong. The abstract Elephant is almost just an oversized wild animal. So why not just use an abstract big animal? Because the story dictates it must be an elephant, and that means it has to at least look like an elephant. I imagine a good (user) reader experience would be that the elephant has a trunk, and big feet. I imagine it sitting on the hood. But the story does not dictate it's position. Does the elphant need a butt? Where is it's tail? How many eyes does it have? Can you see the eyes. Does the man see anything more than a giant grey blob? Does the man even see the elephant at all? Has it left?

More story details, less abstraction

The least abstract elephant has a name, scars, an age, and many other details. Now imagine all the different elephants out there, at the zoo, in Africa, Asia, South America, India. Some wear clotheslike decorations, others mud, and some are young, and some are very old. Some are angry and some are friendly. We can carve away at what makes an elephant by considering all the things one elephant is, but another is not.

Would a trunk alone be an elephant?

No. Just, no. But, an elephant can be missing a trunk. Does it have to be born with a trunk? No. Does an elephant have to be born from an elephant? Perhaps not, it could be cloned.

The story of an elephant

NOTE: There are some mistakes in these charts, but they are useful for fleshing out the abstraction.

Is it an Elephant?

An elephant must just look like an elephant.

It could be a dog dressed as an elephant.

Is it an Elephant in disguise?

An elephant must look like an elephant while not wearing a costume.

It could be a robot.


OK, so I am pretty satisfied that if it looks like an elephant and after taking off any costumes, it still does, and it's not a robot, then it must be elephant!

It could be an illusion.

You can see how this is progressing into to ruling out a lot of optical illusions that don't really change our story. A robotic elephant and a giant pig dressed as an elephant could both still crush a car, and our story would just get more interesting. But, as Justice Scalia once told me "words have meanings." So, all of these questions are important to determine it is an actual elephant.

When is too much abstraction

It helps to know what level flexibility your elephant will need to fit into all practical stories. So, for our story, we determined that an elephant needs to be big and strong, so as to crush the car, and it must look like an elephant so as to be recognized as one. So, it needs at least a trunk, three to four legs, be grey or brown, not furry Wooly Mammoth style, big ears, tusks?, and big feet. That's it. it could be a robot version of an elephant, so long as we can't tell, so we don't need to specify it's heart, or muscles. It's internals can be anything, so long as it is as big as, looks like, and acts like an elephant.

A Facade Extended to Function Like an Elephant

In a way an abstraction is a lot like a facade, that specifies how something must be to be an elephant. Extending that abstraction to fill in the details and specify how that elephant is different from other elephants: e.g. it wears a cosutme. Elephant costume