Why is there so much money thrown at web and mobile apps that a couple of people could hack together in a weekend? Why is so much time and effort spent on seemingly trivial products such as URL shorteners and social-location-based-mobile apps when we still don’t have a cure for cancer and we haven’t been back to the moon in 40 years?
Take the common attack: “that’s trivial, I could implement it in 10 lines of code“. (The actual number of lines is irrelevant, the sentiment is that anything simple to implement must not be worthwhile).
We’ll use Instagram as an example. Imagine you’re trying to bash out an MVP for a photo-sharing app as quickly as possible, focusing on only the core features — taking photos, uploading them, adding friends and letting them see your photos. That will likely take more than ten lines of code, but not much more — probably not more than a few hundred. A pair of competent eLance programmers could hack your demo together in a few weeks. The mobile app just glues together the iOS APIs for taking photos and file uploads. The server portion is just a basic CRUD app built on top of any of the big web stacks, running on commodity hardware.
Sure, you’ll likely need to add a few features before you flip for a billion dollars, but that’s more a product/design challenge than an engineering one. And you’ll eventually encounter scaling problems, but these days, scaling problems are rarely hard problems. The real Instagram had only two backend engineers but managed to cope with 40 million users, thanks to Amazon EC2 and a zoo of open-source software packages. Just write a few scripts that tie together all this infrastructure and off you go.
Hang on. What was that last sentence again? On closer inspection, our supposedly simple application turns out to be built on a mountain of complicated machinery.
You might be able to achieve amazing things with only a few lines of Rails code, but that’s only because the Rails framework consists of a hundred thousand lines of software. And just as much as your work is reliant on dhh and the rest of rails/core, those guys are mere journeymen programmers who are completely indebted to Linus Torvalds and the Linux team. How could a web framework work without an operating system to build upon?
(The Linux kernel, by the way, consists of over 10 million lines of code. Debian, the Linux distribuition which is serving you this blog post right now, consists of 300 million lines of code. It would take one programmer 15,000 years to re-implement.)
And, in turn, even a legendary programmer like Linus Torvalds is revealed to be a mere mortal when compared to godlike hackers such as Dennis Ritchie and Ken Thompson, the creators of UNIX, whose work he is completely reliant on. And so on back in history, until you realise that computers and the internet wouldn’t work at all without the communication and electricity networks that were built in the Victorian era.
And similarly on the client side. Your iPhone app might consist of just a few API calls, but how many millions of lines of code are required to implement those API calls? And how many man-hours of engineering from Apple, Samsung, ARM et al. are needed to create the hardware all these apps run on? And what about the people that built the 3G towers and GPS satellites that let you upload your filtered snaps and tag them with your location?
Sure, any single mobile app looks trivial. But the fact that mobile apps exist at all is not. Instagram would have been completely impossible thirty years ago. Nowadays, Instagram is ten lines of code.
But each lines of code is highly leveraged. Leveraged both in the financial sense — indebted to the millions of man-years of work that created all this infrastructure — and in the Archimedean sense — a tiny force with the ability to move the world.