Human vs. JSON output formatting: avoid mixing concerns

1 goranmoomin 1 9/8/2025, 9:23:24 AM blog.liw.fi ↗

Comments (1)

dtagames · 1h ago
This is only a concern if you're not writing JS or TS. There, JSON is the native format and it makes more sense to store everything in JSON objects or arrays (which are also valid JSON).

If you create JSON interfaces, scaffold them declaratively, then modify them with destructuring, you can output the values at any time (like for print debugging) in their native form.

LLMs are good at JSON, too, and you can ask them to keep their internal data in JSON while working on a problem, making it easy to save to a file or use elsewhere.