When I first started coding, I wanted everything to be perfect.
Every function should be small and do only one thing. Each component should be slick and reusable. Every line of code should be performant and use the most efficient algorithms.
All of these are great ambitions to have. We should generally strive to create high quality work and write awesome code.
But as I got my first and second front-end job, I also realized something else.
Users - real people visiting your website(s) - really don’t care about these things.
They’re entirely focused on getting a particular job done as quickly as possible. Whether that’s to find information, to communicate with a friend or to solve a pain point.
Now of course there’s an inherent correlation. If all your code is terrible, it will be harder to add new features and your app might be slow. And that’s definitely something users will care about!
But the reality is also that for a vast majority of websites, obsessing over performance is not the best use of your time. JavaScript is fast enough to handle 99% of things people might do on a website. If you have an array of 9 items, it really doesn’t matter if you use a for loop or an array method to iterate them. And it especially doesn’t matter how flexible your components are if your app has 0 users.
That’s why I believe that finding balance between these things are what separate great engineers from mediocre ones. It’s not about who writes the best code - it’s about who can find the right balance:
→ Balance between when to just get a feature working and when to obsess over the tiniest details
→ Balance between when to implement a reusable, flexible component and when to just copy/paste
→ Balance between when to build something yourself from scratch and when to install a library to do it for you
Everything you do should be in service of the people who will actually use your website or app. So if you’re working at Meta or Google, of course you should optimize for performance because you’re literally serving billions of users.
But if you’re working at a start-up or on your personal side project, you’ll be much better off prioritizing new features and using 3rd party libraries to actually ship something people can use.
Avoid getting stuck in the endless loop of perfection, where you’ll only write code that’s highly efficient and perfectly structured.
Aim for it when you can, sure. But don’t let it prevent you from actually building stuff.
Find the balance.
great points! I would make the argument the same can be said for back-end development. Having an API work 5% faster is nice, but having the API in the first place is nicer.
Great point.