4 ms·
> ... schemas aren’t free. You have to coördinate between sender and receiver, and you have to worry what happens when someone wants to add a new field to a mes
by jkaptur 7y ago
> ... schemas aren’t free. You have to coördinate between sender and receiver, and you have to worry what happens when someone wants to add a new field to a message type — but in raw JSON, you don’t have to worry, you just toss in the new field and things don’t break. Flexibility is a good thing.
Much like type systems in general, you always have a schema, and you always have to worry about what happens when someone adds a field. You just get to choose whether it's explicit and you have to type it alllll the way out allllll the time, or whether it's implicit, and is defined as "whatever all the usages are everywhere".
Just as gradual typing is taking over the world (TypeScript, MyPy, etc.), I predict success for something that lets you gradually add schemas to JSON.
- vincnetas 7y ago> ... you just toss in the new field and things don’t break. Flexibility is a good thing. Except when it's not you that are flexible but other parties, and they express that flexibility not only by adding but also removing or modifying fields without notice :/
- erik_seaberg 7y agoI very rarely see system that distinguish between "this new feature can be safely ignored" and "it's not safe to process this message if you don't support this new feature", but I've always thought it a good idea. Like semantic versioning without a global ordering over schema changes.