The Cleanest JavaScript Is the Least JavaScript

You know that feeling. You open a codebase that was written during the ‘modern JavaScript’ hype cycle—optional chaining, nullish coalescing, destructuring on every line, arrow functions nesting like Russian dolls. And instead of feeling grateful, you feel exhausted. You have to mentally parse each syntactic sugar trick before you can understand what the code actually does.

This is the dirty secret of the ‘clean code’ movement in JavaScript: the more clever tricks you use, the harder you make it for the next person to read. And the next person is often you, three months later.

The obsession with writing ‘modern JavaScript’ has turned our codebases into museums of syntactic acrobatics—impressive to look at, impossible to maintain.

I saw this firsthand when a junior developer asked me to review their pull request. They’d used every ES2023 feature they could find: pipeline operators, pattern matching polyfills, record tuples. The logic was correct, but the code was foreign. It looked like a different language. I had to Google three new syntaxes just to understand what should have been a simple loop.

That’s when it hit me: the cleanest JavaScript is often the least JavaScript. The most readable code uses the most boring, predictable syntax. A plain for loop. A simple if statement. A classic function declaration. These never go out of style.

But the industry tells us otherwise. Every blog post, every conference talk, every tweet screams: ‘You’re writing bad JavaScript if you’re not using ??, ?.at(), and Array.groupBy().’ The pressure to stay current is relentless. And the result? A generation of developers who feel guilty for writing code that works.

Let’s be honest: the top comment on that article about modern JavaScript tricks said it best: ‘Going to do a hedgehog move, and stick my head out…. don’t use javascript.’ That’s a joke, but it reveals a deep frustration. JavaScript is the industry’s default, yet it’s also its most complained-about tool. Why? Because we keep adding abstractions that obscure the language’s fundamental simplicity.

Every new JavaScript trick you adopt is a tax on the next developer’s attention.

I’m not saying never use modern features. I’m saying that the truly modern skill is knowing when not to use them. The best JavaScript developers I know have a rule: ‘If I can’t explain this trick to a junior developer in 30 seconds, I don’t use it.’

That’s the twist. The original article promised ‘cleaner everyday code’ through modern tricks. But the real cleaner code comes from restraint. From choosing boring over clever. From writing code that looks like it could have been written in 2015—but works perfectly in 2025.

So the next time you reach for a shiny new syntax, ask yourself: ‘Does this make the code easier to understand, or just shorter to write?’ If it’s the latter, stop. Your future self—and your teammates—will thank you.

Boring code is the most modern code of all.

FAQ

Q: Isn't JavaScript just a bad language? Should we switch to TypeScript or something else?

A: No, the problem isn't the language itself—it's the culture of adding more syntax without considering readability. TypeScript can help, but it doesn't fix the core issue: developers who prioritize clever tricks over clarity. Switching languages is a distraction from the real problem.

Q: So what's the practical way to write clean JavaScript without feeling guilty?

A: Follow one rule: optimize for reading, not writing. Use modern features only when they genuinely reduce cognitive load. For example, optional chaining is great for safe property access, but avoid chaining five destructured objects in one line. When in doubt, write the boring version—it's easier to refactor later.

Q: Aren't you just being a Luddite? Modern features like nullish coalescing and optional chaining are objectively better.

A: They are better in isolation, but the problem is cumulative. Each feature adds a new mental model. The best code is the one that requires the least context switching. Sometimes a simple ternary or a guarded if-statement is more readable than a chain of ?? and ?. and .?. The point is to choose wisely, not blindly.

📎 Source: View Source