Abstraction escape hatches

September 2015

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…

Enjoyed this post? Get notified of new ones via email or RSS. Or comment:

email me replies

format comments in markdown.