Abstraction escape hatches

People think a lot about abstractions and how to design them well. Here’s one feature I’ve recently been noticing about well-designed abstractions: they should have simple, flexible and well-integrated escape hatches.

Inevitably, when you use an abstraction layer to accomplish a task, you’re going to run into cases where you can’t express what you want using the abstraction layer, and you have to “drop down” to a lower-level tool. (For example, you might be using Python and realize that you have a particular loop that’s really slow and needs to be rewritten in C.) Abstraction layers try to pretend they can do everything for you, but that’s never true, so it’s vital that they make the process as painless as possible.

There are three main things that such an escape hatch should be:

Specific examples to come when I’m not about to board a flight…

Comments

email me replies

format comments in markdown.

Your comment has been submitted! It should appear here within 30 minutes.