Making hell less hellish encourages more time in hell

dependency hell

If you look at the recent issues we've seen with widely used libraries like axios being corrupted by bad actors and then blithely loaded into the dependency hell of modern stacks you're looking at the latest demonstration that reducing the cost of something increases its utilization. Make electricity cheaper, people use more electricity.

This is generally a Good Thing. It makes us wealthier. People started washing their clothes more when the washing machine made it much less time consuming to wash clothes.

But when it's easier to add a dependency to pad a string than to just write a function or do it inline and then you create a transitive dependency that could at any time blow up in your face, then there's a hidden cost and you don't pay it.

In the case of axios, you're basically using a library function to do something that is done natively, but wasn't in the past. So you now have a dependency that makes you vulnerable to any bad actor in axios's dependency chain, including in this case axios itself. And because there are many careless developers out there (e.g. Slack uses a bunch of old libraries it shouldn't and requests for them to address this go back five years or more) these problems and costs compound.

The ultimate expression of this approach, right now, is Docker. Docker is the engineering solution for "it works for me". It used to be that if you wrote some code and it worked, but then when you passed the executable to testing and it failed, this was considered a bug. Clearly your code didn't really do what you thought it did and you should fix it. Docker says, no, create a house of cards and then ship it. Or, to put it another way, to deliver a letter you need a post office. To build a post office you need a city. To deliver a letter just build a city with a post office. What could go wrong?

Now, bear in mind, dependencies are necessary. Being able to predictably stand up a configured server deterministically is necessary. But driving the cost of doing these things close to zero externalizes the remaining costs of doing this, and those costs are not borne up front. In the short term, your software / server "works". In the long term, it's hard to debug, maintain, and may have any number of hidden security flaws. Because the project I am working on was spun up fast without a real care for dependencies, we have to deal with security vulnerabilities in our dependency tree on a near daily basis.

All the horrors we're seeing with transitive dependencies are compounded by Docker, because Docker is a giant pile of these things assembled into houses of cards. And sure, some hackers will just inject backdoors and exploit them instantly, but not patient ones.

Back at the beginning of my career I had to do a lot of cross-platform development. We were building multimedia products on Macs but most of our users used PCs. This meant that, for example, we needed to know about text encoding before it became a thing for anyone else. We had to know that the Mac and Windows platforms had differently structured file systems and different separators. Up-front, this seemed like a cost. It made getting things working a little harder. But in the end—and this is one of the few cases where I think "making simple things more complex can make complex things more simple"—it was actually a benefit because it meant we weren't complacent about our target platform.

I think that Docker is the ultimate expression of allowing engineers to disregard major flaws in reasoning by allowing their bad assumptions to be shipped with code. It's an anti-pattern for thinking, and it's an anti-pattern for execution (because you literally spin up a container to execute a function).

And it's one of the driving motivations for building tjs.

— Tonio Loewald,