The goal isn’t to write less code

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…


This content originally appeared on Go Make Things and was authored by Go Make Things

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.


This content originally appeared on Go Make Things and was authored by Go Make Things


Print Share Comment Cite Upload Translate Updates
APA

Go Make Things | Sciencx (2024-09-06T14:30:00+00:00) The goal isn’t to write less code. Retrieved from https://www.scien.cx/2024/09/06/the-goal-isnt-to-write-less-code/

MLA
" » The goal isn’t to write less code." Go Make Things | Sciencx - Friday September 6, 2024, https://www.scien.cx/2024/09/06/the-goal-isnt-to-write-less-code/
HARVARD
Go Make Things | Sciencx Friday September 6, 2024 » The goal isn’t to write less code., viewed ,<https://www.scien.cx/2024/09/06/the-goal-isnt-to-write-less-code/>
VANCOUVER
Go Make Things | Sciencx - » The goal isn’t to write less code. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/09/06/the-goal-isnt-to-write-less-code/
CHICAGO
" » The goal isn’t to write less code." Go Make Things | Sciencx - Accessed . https://www.scien.cx/2024/09/06/the-goal-isnt-to-write-less-code/
IEEE
" » The goal isn’t to write less code." Go Make Things | Sciencx [Online]. Available: https://www.scien.cx/2024/09/06/the-goal-isnt-to-write-less-code/. [Accessed: ]
rf:citation
» The goal isn’t to write less code | Go Make Things | Sciencx | https://www.scien.cx/2024/09/06/the-goal-isnt-to-write-less-code/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.