Everything's an API
Hi Everybody,
April Cools is this weekend! A bunch of people who normally write tech stuff will be writing about a bunch of other topics. If you've got a blog and find April Fools to be eye-rollingly trite, come join us! You don't need to pour your heart and soul into a 10,000 epic, just write something fun and genuine and out of character for you.
I've got a lot on my plate this week, so I'll keep this newsletter short and sweet. Hyrum's law:
With a sufficient number of users of an API, it does not matter what you promise in the contract: all observable behaviors of your system will be depended on by somebody.
Fair enough, but what do we mean by "API"? We always use "API" to mean the official designated interfaces, but when you get down to it, you can use anything as an interface!
- GUIs: I once had to work with a system that had some of the critical features only in the API, and some features only in a GUI. The only way we could get it working was to first do some stuff in the API, then load up a Selenium browser, navigate to their site, log in, and click some buttons. More
- The beeps your system makes: Phone In-band signalling. You know that Phone "number not in service" beeps? That carries information. See also phreaking.
- CSS classes: Used by adblocks, custom styling, and browser automation. I have an irrational hatred of websites that name their classes stuff like
x1iorvi4
because it makes it impossible to use adblock or browser automation.- I usually get around it by using the HTML layout as an API. HTML is also important for screen readers.
- Button and image layout: Both AutoHotkey and PowerAutomate can look for a specific image on a screen to click on.
- Syntax highlighting: A while back I wanted to make a TLA+ vim plugin that handled indentation well. Vim's native indent functionality is terrible and Treesitter wasn't a thing yet, but I was able to get something working by reading how many syntax rules applied to the current line and inferring indentation from that. Yes, I am ashamed.
- Performance profile: The entire genre of timing attacks use running time to extract information.
- Physical circuit characteristics: In 1997, a genetic algorithm designed a circuit with unused elements that, though EM coupling, somehow improved the performance of the main circuit. Then in 2014, researchers discovered Rowhammer. These are unrelated but are pretty good examples of the "API" here.
- Physical buttons: ITAPPMONROBOT
The point isn't that you need to be backwards compatible with everything, which would be insane. But people make programs to solve problems, meaning they will use whatever tools they have available. And if the only thing you make available is the color, they will use that.
There's no call to action here. I just think it's neat.
If you're reading this on the web, you can subscribe here. Updates are once a week. My main website is here.
My new book, Logic for Programmers, is now in early access! Get it here.