logoalt Hacker News

codewriteroyesterday at 7:23 PM2 repliesview on HN

I love to see people advocating for better protocols and standards but seeing the title I expected the author to present something which would be better in the sense of supporting the same or more use cases with better efficiency and/or ergonomics and I don't think that protobuf does that.

Protobuf has advantages, but is missing support for a tons of use cases where JSON thrives due to the strict schema requirement.

A much stronger argument could be made for CBOR as a replacement for JSON for most use cases. CBOR has the same schema flexibility as JSON but has a more concise encoding.


Replies

port11yesterday at 7:27 PM

I think the strict schema of Protobuf might be one of the major improvements, as most APIs don't publish a JSON schema? I've always had to use ajv or superstruct to make sure payloads match a schema, Protobuf doesn't need that (supposedly).

youngtaffyesterday at 7:44 PM

We need browsers to support CBOR APIs… and it shouldn’t be that hard as they all have internal implementations now

show 1 reply