DEV Community

ben_chen
ben_chen

Posted on

The 200-Line JSON Formatter: When Good Code Is Still Wrong

I once reviewed a PR where someone wrote 200 lines of Python to do what a JSON formatter does in one click. The code was good. But it never needed to exist.

The Over-Engineering Trap

Building feels productive. Adding tests feels like progress. Handling edge cases feels responsible. But every line you write is a line you now own — maintenance, docs, code reviews.

The best code is often no code at all.

What I Recommend

  1. Check if the problem is already solved before writing code
  2. Use the right tool — for JSON, a browser formatter is instant
  3. Write code as a last resort

Opennomos Json does formatting, validation, and conversion in one browser tab. No install, no setup: https://www.opennomos.com/en/project/01KJ850Z7PNGXHXESBM68HE12Y

Before asking if the code is good, ask if it needs to exist.

Top comments (0)