Skip to content

Comment on Reasons to use protocol buffers instead of JSON

Comments

There do remain times when JSON is a better fit than something like Protocol Buffers, including situations where:
* You need or want data to be human readable

When things "don't work" don't you always want this feature? Over a long lifetime, this could really reduce your debugging costs. Perhaps protocol buffers has a "human readable mode". If not, it seems like a risk to use it.

You can run the binary format through `protoc --decode` to get text, or use the `toString()` method in your code. It's an extra step, but for the 99.99% of queries that no human looks at, it saves a lot of CPU.

AboutSource Built by g1lg1l

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