New Sep 6, 2024

The goal isn't to write less code

Multi Author Blogs All from Go Make Things View The goal isn't to write less code on gomakethings.com

I’m convinced that nothing has done more damage to the web than this notion among developers that writing less code is an admirable pursuit.

(Ok, fine. Capitalism has done more damage. But other than that!)

It’s why people kept shipping the entire jQuery library to toggle a few classes on some elements long after the native web was capable of doing all the same things.

Because this…

$('.sandwich').addClass('mustard');

Is a few characters shorter than this…

document.querySelectorAll('.sandwich').forEach((sandwich) => {
	sandwich.classList.add('mustard');
});

And in exchange for writing 67 fewer characters, we sent 87.5kb of JavaScript to our users.

In more recent years, it was React.

Instead of writing some manual DOM manipulation or choosing a lightweight library to do what you need, we shipped literal megabytes of JavaScript to users.

Today, it’s AI.

I’ve literally had people who work as coders tell me that they hate writing code. They like AI, because it writes the code for them steals other people’s code, sanitizes the copyright, and spits it out as unique and original code.

The goal isn’t to write less code.

It’s to ship less code to users. Better code. Faster code. More resilient code.

For years, our industry has trended towards slower, buggier, more fragile, worse-in-every-measurable-way-except-speed code.

It’s not better to produce a car in half the time with brakes that don’t work, and it’s not better to write code in less time if your users can’t actually use the fucking thing you built.

🎉 Preorder Getting Sh!t Done today and get 40% off! Be more productive, get more done, and feel more in-control of your work and life. Click here to learn more.

Scroll to top