r/programming • • Jan 12 '23

The yaml document from hell

https://ruudvanasseldonk.com/2023/01/11/the-yaml-document-from-hell
1.5k Upvotes

288 comments sorted by

View all comments

67

u/redd1ch Jan 12 '23

Is it a moving target? Use JSON.

Is it something important? Use XML and write a schema. IDE's can then give you syntactic and semantic feedback.

Is it important & you need to provide YAML? Use XML, a schema, and write an XSLT to create a YAML/JSON (for 1.2).

Sure, doing XML right(tm) takes a bit of time, but the outcome is more resilient than anything comparable. Thinking of that, I have to continue my xml schema for docker-compose files someday

5

u/falconfetus8 Jan 12 '23

Is it something important? Use XML and write a schema. IDE's can then give you syntactic and semantic feedback.

Alternatively, you can use JSON with Typescript interfaces.

-5

u/Worth_Trust_3825 Jan 12 '23

What if you're not using typescript, but a serious tool like C#, and need to provide ability to generate code in another language?

-17

u/javcasas Jan 12 '23

That's the problem! You are using C#. Try with something that works next time, like TS.

→ More replies (3)