4 ms·
> Before looking for something 'better' than JSON, build a basic prototype of your app and see if your application actually needs to use something else. That i
by maltalex 9y ago
> Before looking for something 'better' than JSON, build a basic prototype of your app and see if your application actually needs to use something else.
That implies that JSON is somehow the gold standard of serialization formats. I don't see it that way. The fact that JSON is ubiquitous in some areas doesn't mean that it's the gold standard for all other uses.
In my experience, protobufs are easy to work with, concise, safe, and efficient. There's never any ambiguity to them, and both creating and parsing messages is fast and easy. That doesn't mean that there aren't cases in which JSONs aren't a better choice, for instance when working with browsers, or needing a text based format for debugging or inspection purposes.
> Protocol buffers are very clever and really cool but using them where you don't need them is a huge waste of effort.
In my experience protobufs require very little effort, with most of the effort being put into defining the schema. It's pretty frictionless afterwards with one notable exception - when you want to manually inspect a message. That's where JSON wins hands down.
- cdancette 9y agoProtobuf seems more complicated to debug manually.
- onion2k 9y agoThat implies that JSON is somehow the gold standard of serialization formats. I'm not suggesting JSON is the best format, because that depends on the project you're working on. I'm saying it's good enough for most tasks, and has ubituous support, and it's easy to work with. There are better formats for particular use cases but if your application has requirements that can work with JSON it probably isn't worth finding something else.
- skybrian 9y agoProtobufs do require more effort in the toolchain. Pretty much the only way to parse a .proto file is with protoc and you might need to build it from source. So you need to run the C++ compiler and depending in the build system you're using, adding a dependency on protoc at build time can be a pain. Contrast with JSON where every decent language ecosystem has a parser readily available. That's what makes it the "gold standard" for me.