Skip to content

Comment on Reasons to use protocol buffers instead of JSONparent

Comments

Avro code is generated though?

For anything non trivial, putting data into an Avro object and pulling it out is manual and tedious. Instead of json_parse("{'nice json':'string'}) you have to assemble the object and for large hierarchical objects this is a pain. And then you want to return that object to the UI. Well it's not standard JSON. For example the arrays aren't simple arrays. My team has code to fix these kinds of things but it's not nearly as easy to use as JSON.

tl;dr Avro JSON != Standard JSON

The OP's assertions that the protocol buffer's are awesome and reduce boilerplate conflict with my experience.

I don't see how "standard JSON" could be any easier when it's even less structured.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.