Hacker News new | ask | show | jobs
by secondcoming 2114 days ago
IMO it needs two things:

- a dedicated editor with intelligent autocomplete

- stop using YAML, it soon becomes unreadable. JSON is easier to grok.

4 comments

JSON is easier to grok.

For anything non-trivial you will want inline comments.

Also while any JSON can be expressed in YAML, the reverse is not true.

> For anything non-trivial you will want inline comments.

Yes, JSON needs comment support back.

> Also while any JSON can be expressed in YAML, the reverse is not true.

This is a feature not a bug.

Unfortunately, JSON is much more annoying to edit.

Best way is to stop using both, and generate the objects from higher level language, at least something like Jsonnet (which is really just a step up, so better not stop there but I will take what I can)

> generate the objects from higher level language

I'm on the fence about this, something like Dahl seems good, but I am not a fan of using fully-fledged higher level languages (the Pulumi approach) as I've been burnt before with devs writing bad code and generating configs in the most confusing, convoluted way possible.

> a dedicated editor with intelligent autocomplete

A.K.A. a schema file that a general purpose editor can consume. Please don't make me use some single-purpose editor just for autocomplete.

Kubernetes schema files and a way to run them can be found at https://www.kubeval.com/
Isn't YAML supposed to be a superset of JSON? So technically, you should be able to use JSON files right now (barring a few exceptions).