←back to thread

JSON Patch

(zuplo.com)
299 points DataOverload | 1 comments | | HN request time: 0s | source
Show context
hyperhello ◴[] No.41881157[source]
What’s nice about JSON is that it’s actually valid JavaScript, with some formal specification to avoid any nasty circles or injections.

Why can’t your protocol just be valid JavaScript too? this.name = “string”; instead of mixing so many metaphors?

replies(2): >>41881202 #>>41881252 #
tablatom ◴[] No.41881252[source]
> Why can’t your protocol just be valid JavaScript too?

It is.

replies(1): >>41881301 #
1. hyperhello ◴[] No.41881301[source]
It’s delivered in JSON, but you need an interpreter. But the actions are just JS assignment statements and a little glue. Your interpreter could as easily handle that, and with far less bytes. Why call a member variable /name when it’s already .name?