Settings

Theme

Human vs. JSON output formatting: avoid mixing concerns

blog.liw.fi

1 points by goranmoomin 3 months ago · 1 comment

Reader

dtagames 3 months 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.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection