3 ms·
Isn't this easy though? Just don't over-use OOP. Structured data can also be stored as just structured data. > I think I'd be tempted to use some binary format
by its-summertime 2y ago
Isn't this easy though? Just don't over-use OOP. Structured data can also be stored as just structured data.
> I think I'd be tempted to use some binary format
And now you require both sites to use a binary format for representation. And then you have the same list of challenges.
- sfink 2y ago> Structured data can also be stored as just structured data. Fair point. I probably overstated the weaknesses of the JSON model; it's fine for many uses. But I like Map, and Set, and occasionally even WeakMap. I especially like JS objects that maintain their ordering. I'm even picky enough to like BigInts to stay BigInts, RegExes to stay RegExes, and graphs to have direct links between nodes and be capable of representing cycles. So perhaps it's just the nature of problems I work on, but I find JSON to be a pretty impoverished representation within an application -- even with no OOP involved. It's great for interchange, though. >> I think I'd be tempted to use some binary format > And now you require both sites to use a binary format for representation. And then you have the same list of challenges. Requiring the same format on both sides is an important limitation, but it's less of a limitation than additionally requiring that format to be JSON. It's not the same list of challenges, it's a subset. Honestly, I'm fond of textual representations, and avoid binary representations in general. I like debuggability. But I'm imagining an application where JSON Patch is useful, as in something where you are mutating small pieces of a large structure, and that's where I'd be more likely to reach for binary and a robust mirroring mechanism.