Everything is supply chain management
21 August 2021
A few weeks ago, Github announced Copilot. They call it an AI pair programmer. It is the next level of autocomplete. It will write entire procedures for you based on context. The news was flooded with excitement. I witnessed a lot of suggestions on how this will revolutionise the software industry. I don’t know about that. Maybe it will. Perhaps it is indeed helpful for many folks, but I found no inkling of excitement in myself. I have tremendous appreciation for what they have built as an engineer. But I don’t particularly look forward to using it. I cannot remember a situation where a tool like this would have considerably improved my productivity. It would have made an incremental difference, sure, but not a revolutionary difference. I don’t spend the toughest hours of my week struggling to write a procedure, thinking about optimal syntax to achieve what I want to achieve. I am pretty comfortable with the languages and frameworks that I need to use. As far as the algorithm is concerned, a brute-force approach goes a long way. Optimisation always comes much later. And even then, the internet search is good enough for the number of times I need to do it. What then is the challenge in my life? What do I spend the toughest hours of my week doing?
This week I had to shift houses. I used to live in a 3 BHK with a couple of friends from college. They’re moving out of the city, and I am too lazy to find new flatmates. I decided to move into a 1 BHK. I am mentally old enough to enjoy my privacy more than I would enjoy the comfort of constant company. In minimising the assets that I own, I decided to send a box of books to my parents’ house since I have lesser space now. I’ve already read these books, and they’ll be better maintained in my parents’ library. The box weighed a little over 40 kgs and had to be transported about 2000 km. We started brainstorming on what are the best ways to transport it. Standard options like courier were too expensive. Our best option for a while was train freight. But then, a friend suggested we try a business logistics company. They have an option to transport LTL (less than truckload) which I can avail of. And listen, it has so happened that the world is going through supply chain problems caused by the Covid-19 pandemic. Hence, I’ve spent a fair deal of time recently learning about the shipping and trucking industry. I was excited to book cargo for intercity transport myself. (shoutout to Joe Weisenthal and Tracy Alloway from the Bloomberg Odd Lots podcast). This is obviously nowhere close to international shipping, but it’s more than sending a courier.
Step one was to find a cardboard box to pack the books in. Obvious retail options like Amazon and Flipkart were either too expensive or did not have an acceptable box size. We found a packaging company on Justdial and went to them physically to purchase a few boxes. That was easy. Then, you simply go to the nearest warehouse of the logistics company. I had to submit a couple of copies of my ID to the administrator at the warehouse. He punched the addresses and other details. Then, I paid what was owed and collected a receipt with tracking and further information.
Let’s look at what happened to the package after this. I live in Bengaluru, and my parents’ house is in Jodhpur. The box went to a central facility in Bengaluru the next day. After that, it left for Jaipur. And then a smaller truck took it to Jodhpur.
I sent my parents a message on Whatsapp with the tracking details of the package. Let us also look at what happened to that message. The bits my phone registered on to the touchpad were not immediately transmitted to my father’s phone. They would be transferred to Whatsapp’s application layer. Whatsapp would process them and pass them along to various other layers before they are transmitted. Well, the transmission would also hop around multiple times before reaching my dad’s phone. Then it would pass multiple layers before reaching the application layer of Whatsapp on my dad’s phone. Now, Whatsapp on his phone would process the information and then render a display that completes the communication chain.
Suppose the Whatsapp developers were to use an AI pair programmer. In that case, it could probably assist in writing each procedure required to transfer information to/from application from/to operating system. It can’t learn (at least yet, or immediately) how to change these procedures for a change in specifications of the communication standard from the OS. This would be equivalent to the government introducing a new form to fill if you want to send a package interstate. Well, that’s not true. An AI, or maybe even a dumber computer, can help you modify these procedures, given the specifications of this additional form. But what it surely cannot do is anticipate this change, interpret the deadline for this change and plan a timeline for the corresponding changes in the application. The evolution of communication standards between different software is a fundamentally human decision. It is driven by changes in the requirements of humans. What I am labelling as communication standards here is nothing else but APIs. There would never be any need for APIs if everything was one software, but it isn’t. And it can’t be.
Would you eliminate the need for food supply chains if everyone lived in one large house? It is physically impossible. Look, the whole point of life is enabling a physical process to move energy against entropy. Our civilisation is nothing but elaborate supply chains of resources.
Software, too, is such a process. It is simply an information supply chain. And since it takes space to store information, the rest of it is nothing different. Sure, it takes much less space to store data than a box of books or a kilo of rice. And we’re constantly able to reduce that space and make computing and storage faster as a result, but it would always occupy finite space.
IT has revolutionised the world by making processes within a supply chain faster and less error-prone. Still, it cannot do anything to solve your supply chain management problems. Most of them are NP-hard, and you need a creative human to do those for you. Some of these optimisations can be solved under relaxation, but again, that’s a human choice to make.
Bugs happen because some part of your code expects information in a different format. Perhaps it receives incorrect information, or perhaps it never receives any information at all. What else is a null pointer exception than missing information? Your package got dropped in transit because you filled in the wrong address. A function returned null because you provided it with unexpected inputs. In both cases, you will add a layer of robustness by checking the inputs against expectations.
This is not to argue that software does not add any value. The logistics warehouse administrator could have made an error while doing my paperwork. He was also slow. It took a good fifteen minutes for everything. A computer program will not make an error and would be faster in such a situation. A computer would also be cheaper to scale.
However, a computer system would also not be able to overlook specific errors. Computers do not make errors because they literally cannot deviate from what they are asked to do. But let’s say there is an error with the input. I put the pincode of my address incorrectly, and a computer was in charge of delivering the package to my door. What happens now? I assume it would simply fail the task. A human can make out the mistake from the rest of the address. They are likely to know the building and the general area. A computer can do that too, by the way, if it is explicitly asked to. But most humans don’t need to be “explicitly” asked to overlook obvious human errors. Regardless, to decide that your computer should be trying to verify or estimate the address is a supply chain management problem. An AI can help you write the procedure to calculate a correct address from an incorrect address, maybe.
To clarify again, I am not against AI tools such as Github Copilot. I am using Grammarly to write this. It helped me correct a lot of errors and had great suggestions to rephrase certain parts. It was helpful, but it did not reduce my time struggling to compose my thoughts. I am simply trying to point out a difference between an incremental tool and a revolution. That is also the minor point of this article. The primary purpose is to demonstrate how the most challenging aspects of software development are simply supply chain management problems.
The internet, too, is run on a supply chain fulfilled by companies like Akamai. I was discussing with my partner last week how few people remember how such companies form the backbone of the internet. Caches deliver content to you with unimaginable speed. Suppose a video is viral on Facebook in your state. In that case, it will end up being stored on a cache physically located nearest to your state and delivered straight to you from the cache. This is quite akin to how Amazon would keep goods in warehouses close to an area if it anticipates buyers from that area to optimise the speed of delivery.
I want to pitch the advantage of seeing things this way. It is empowering to see software as a tool and only a tool to solve human problems. It is not a magic wand, and while what it does can often seem magical, it will not solve your supply chain problems for you. You still need to work out how you’re going to use it.
The toughest hours are spent deciding what the optimal way to transfer information between software systems is. Is it better to store an intermediate calculation in an object database or a NoSQL database? The type of the warehouse obviously determines its properties in the supply chain. The toughest hours are spent wrangling with an API upgrade which may require a significant refactor of our codebase. The toughest hours are spent figuring out how a data row went missing from the user interface while it is present in the database.
Everything is supply chain management.