I’ve seen it happen a couple of times, someone (me including) spends hours micro-optimising some front end code, only to discover later that the feature didn’t even meet the business requirements or a valid edge case was missing completely.
Kent Beck captured this perfectly: “Make it work, make it right, make it fast.”
Because here’s the truth:
If the code doesn’t meet the acceptance criteria, it doesn’t matter that we used the latest tech, some clever memoisation technique that we read in a blog post or the most elegant one-liner that has more chains than Starbucks franchise map.
I’ve also seen teams dive into optimisation far too early, like tuning an API endpoint for performance before it’s even exposed to the frontend. Then, once the frontend team requests a different data shape, the backend has to call another service, and all those “performance gains” are thrown away.
At this stage, speed is irrelevant. The only thing that matters is delivering a working solution that solves the problem end to end.
Once your code works, the next step is to make it right:
Remember, we read code at least 10 times more than we write it. A function that’s clear and explicit will save hours of debugging and onboarding pain down the line.
Clever, cryptic code may feel satisfying in the moment, you might say to yourself that you are proud of that code, but future you, or your teammates, will pay for it later. Clarity is what keeps systems healthy and teams productive.
Early in my career, I worked with a colleague who was one of the cleverest developers I’d ever met. I was hungry to learn, and everything he did in the codebase looked like magic to me. He’d walk me through his architecture decisions and optimisations, and while I didn’t fully grasp them at the time, I was impressed.
Then, a month later, he left 🥲 and I was suddenly responsible for that “beautiful soup” of code. It worked - until it didn’t. When I had to reproduce a tricky user state and handle a new edge case, I spent two full days just trying to untangle his premature optimisations and complex abstractions. In the end, I had to flatten large parts of the code just to understand what was going on.
That experience taught me a hard truth: when there’s a big gap in seniority on a team, and there aren’t enough tests or documentation, clever code quickly becomes fragile code. Without a clear flow, strong testing coverage, or well-written docs, even good intentions can turn into a maintenance nightmare.
Finally, and only after your code works and it has been covered well with integration tests (the code is right), it’s time to look at performance.
But first, ask: does this actually need to be faster?
Optimise if either the user or the business will have value of that optimisation.
Readable code should always come first. Ask yourself simple questions: is that variable name clear enough? Does that block of code make sense on its own? Have some consideration for the developers who will maintain this after you - what feels clever today can easily become confusing down the line. And in most cases, a micro-optimisation that doesn’t improve the user experience or deliver measurable business value simply isn’t worth the trade-off.
Software craftsmanship isn’t about building perfect code on the first try. It’s about building in the right order:
Everything else is noise.
Performance is powerful - but correctness and clarity are what make your software, and your team, sustainable in the long run.
Subscribe to get updates on new blog posts, useful frontend tips and ideas you can apply in your own work.