Code Bloat Has Become Astronomical

A file upload tool requires 230 MB and 2,700 files to copy a few files from client to server. This isn't bloatware or overengineering — it's absolute, complete, obvious, blatant insanity.

Code Bloat Has Become Astronomical

Code bloat illustration

From time to time I use a certain service: I need to upload files to some location (the name of the service doesn't matter, because, frankly, they're all the same). Essentially, I just point to a folder on my hard drive, after which its contents are copied to a remote server, where presumably something database-related happens — the files get names assigned and checks are performed on who downloads them.

The service is owned by a large company, so its processes are large-scale; it's probably frequently targeted by hackers, so some protection is needed, as well as verification that the files haven't been modified between upload from my computer and reception on the server. I understand all of that.

...but essentially, what we're talking about is registering a few files, reading them, uploading them, then closing the connection and writing to a log file whether everything went successfully, and if not, what exactly went wrong. There's nothing complicated about this, and even I once wrote similar code from scratch using the Wininet API and PHP on a server communicating with my MySQL database. Sure, my system probably wasn't as robust as enterprise-grade systems, but it supported hundreds of thousands of uploaded files, their verification, downloading, and logging. That's probably a two-to-three-week job for one coder, right?

The special upload tool I use today has a total of 230 MB of client files and involves 2,700 files to manage this process.

You might think that's a typo, but there's no mistake here: two thousand seven hundred files and 237 MB of executable and supporting files to copy a few files from client to server. This isn't bloatware or overengineering — it's absolute, complete, obvious, blatant insanity.

The problem is that this uploader is probably no different from any similar modern software made by any other large company. Oh, and by the way, it's showing error messages and currently isn't working.

I've seen coders who do this kind of thing. I know how it happens. It happens not only because coders don't write low-level efficient code to achieve their goals — they've simply never seen low-level, efficient, well-written code. How can you expect them to create something better if they don't even realize it's possible?

You can write a program that uploads files to a server reliably, quickly, and securely, and it would require a twelfth of the code. It could be a single file, just one small .exe. It doesn't need hundreds upon hundreds of DLLs. This isn't just possible — it's easy, and such a solution would be more reliable, efficient, and easier to debug, and (let me emphasize) it would actually work.

You might think that only grumpy old programmers over fifty (like me) complain about code bloat because they're old and grumpy. And I realize that. But the old and grumpy complain about code that runs 50% slower than it should, or code that's 50% larger than necessary. But the situation has gone far beyond that. We've reached a point where, I sincerely believe, 99.9% of the code in the files on our PCs is absolutely useless and, damn it, never even gets executed. The code just sits there in a package of 65 DLLs, simply because a coder wanted to do something trivial, like save a bitmap, and had no idea how simple that actually is, so they imported a whole heap of bloatware to solve the task.

As I said, I really shouldn't be angry at young programmers for this. That's exactly how they were taught. They have no idea what high performance or development under constraints means. If you tell them that the original Elite had a vast galaxy, 3D space combat, a career progression system, trading, and thousands of explorable planets, all fitting into 64 KB, they'll hear you, but they won't grasp the chasm between that and what we have today.

Code bloat illustration

Why does this matter to me?

This concerns me for many reasons, not least because if you need two thousand times more code to accomplish a task, it should at least work. But more importantly, I realize that 99.9% of the CPU time on my enormous, powerful PC is completely wasted. It performs billions of operations per second just to sit idle. So right now it should be in ultra-low power mode, all fans silent, because all I'm doing is spell-checking while typing into WordPress.

Ha. WordPress.

Today, computers are so fast that we should perceive them as absolute magic. Everything you could possibly imagine should happen within 1/60th of a second. Yet when I click the volume icon on a Microsoft Surface laptop, I see a delay: the machine gradually creates a new UI element, figures out which icons to render, and then they appear and become interactive. This takes time. About half a second, it seems, which in processor time scales is close to a billion years.

If (by conservative estimates) 99% of our PC resources are currently wasted, we're also wasting 99% of the computer's energy consumption. This is absolutely criminal. And what is it all for? I have no idea, but if you look at Task Manager, you'll see a ton of bloated software garbage doing god knows what. I'm just typing this blog post. Windows has 102 background processes running. My NVIDIA graphics card currently owns 6 of them, and some of those have subtasks. For what? I don't have a game running; I'm using practically the same set of video driver features as twenty years ago, yet somehow 6 processes are needed.

Microsoft Edge's Web View also needs 6 processes, as does Microsoft Edge itself. And I'm not even using Microsoft Edge. I think I opened an SVG file yesterday, and here we are — 12 useless pieces of code pointlessly occupying memory and probably polling the CPU as well.

This is utter, utter insanity. This is exactly why nothing works, everything is slow, you need to buy a new phone every year and a new TV to download these bloated streaming apps, which also hide equally bad code inside.

Personally, I think it's only going to get worse, because the big, stupid, useless tech companies like Facebook, Twitter, Reddit, etc. are the worst examples of this trend. Soon, every one of the thousands of "programmers" working at these companies will be using machine learning to copy-paste bloated, buggy, sprawling garbage from GitHub into their code. Just to add two numbers together, you'll need 32 DLLs, 16 Windows services, and a billion lines of code.

Twitter has two thousand developers. Tweetdeck sometimes refuses to load the users column. This has been happening for four years. I'm sure none of the coders has any idea why this happens, and the underlying code is just a heap of bloated copy-pasted manure.

When suggesting a topic title from link text, Reddit can't handle an ampersand, semicolon, and pound sign. It's 2022. The company probably also has two thousand developers. Obviously, not a single one of them can make a text parser work correctly. What are all these people getting paid for?

There was once a golden age of programming when we had constraints on memory and CPU. Today we live in a pit of inefficiency and enormous waste of resources. This is very sad.