3 ms·
It wouldn't really change anything, it's just a data format. The problem is how to get people to both send and receive specific fields correctly. Lazy programme
by 0xbadcafebee 6y ago
It wouldn't really change anything, it's just a data format. The problem is how to get people to both send and receive specific fields correctly. Lazy programmers/vendors would also still think they could throw together some crappy code and pretend it's generating JSON, but it would end up generating illegal JSON. Same for parsing.
There are a lot of things you need in order to prevent the lazy from fucking up:
- A version. A lazy programmer might either ignore or hard-code a version number, but at least you have a hint as to which standard you're trying to conform to, and can retain backwards compatibility. (The new RFC has a version, but the old one doesn't, preventing interoperability)
- A format that's easy enough for programmers to understand, but difficult (or "feature-filled") enough that they won't attempt to implement it all themselves and will reach for real libraries.
- Extensions. Vendors will always want to do something different than everyone else, so if you don't add the option of extensions, they will either fork the protocol and make breaking changes, or try to sneak changes into other parts of the protocol/format.
- A standard reference implementation + tests. Make it easy for vendors to test their versions against another one, so the developers don't have to do busy-work like "read a standard" or "write tests".
- Think about the future. Does your standard include a specific width integer? Does it preclude a specific network payload size? Will addressing change in the future? Can your data payload support arbitrary binary data? Can your standard change later and still be backwards compatible?