bitwig / dawproject

Open exchange format for DAWs
MIT License
765 stars 19 forks source link

XML vs JSON or YAML #27

Closed anthumchris closed 2 years ago

anthumchris commented 2 years ago

I'm curious to know why XML was chosen as the portable data format instead of using other interoperable formats like JSON or YAML. Does XML provide benefits to developers, specific platforms, or programming languages that JSON/YAML would not?

kurasu commented 2 years ago

In XML you can use the element name to represent types, wheras with JSON you would need to manually add a type field and do a lot of extra work to map that onto your types. With XML you can just use an off-the-shelf parser and get sensible stuff out of it. I actually tried doing it with JSON first and don't regret switching.

kurasu commented 2 years ago

they main actual issue was polymorphism, that's when you really need the type name, in other cases you can sort of imply the type from the context.