Insidious Arrogance

There’s this problem that comes when one deals with a complicated system or process for a long time — one internalizes all the details and complexity, and starts to factor all the weird inner workings of the system into communication about the system. In human terms, this is where professional jargon comes from. There’s stuff to be said about that, but that’s not what I’m thinking about right this second.

What’s got me going off today is this swell warning from the documentation of a framework I’m using:

Combine’s Publishers.Concatenate operator, which this function uses, can leak when its suffix is a Publishers.MergeMany operator, which is used throughout the Composable Architecture in functions like combine(_:).

Here are some questions that come to mind:

  • Leak what? Memory? Threads?
  • Are all the functions in Composable Architecture which use this dangerous Publishers.MergeMany operator marked, so that I’ll know not to use them with this code?
  • The guys who develop The Composable Architecture are undoubtedly smart and skilled. But do they really think that it’s a great idea to be fully aware of all the implementation details behind every API call you make?

This last one is the part that gets me. This kind of deep knowledge is good, possible, and even necessary when you’re writing small, tightly scoped bits of code that you want to optimize like crazy. However, once you start writing code that spans multiple platforms and does lots of different things (such as, a desktop app, a phone app, a server app, the backing database, as well as load balancer and mail gateway) then there are just too many things to keep track of. Knowing all the implementation details of every API your code calls would mean taking weeks to write a single function, forgetting other stuff (like your wife’s name) to make mental room, or both.

And then, saying to consumers of your code, “I had to know all this stuff, so you should, too,” is just the capstone of arrogance.

Which is why that warning in the documentation really just means, to me, “Don’t actually call this function.”

Published by pirateguillermo

I play the bagpipes. I program computers. I support my family in their various endeavors, and I enjoy my wonderful life.

Leave a ReplyCancel reply