3 ms·
They have a text format if someone chooses to share it with you. Saying that protocol buffers have a text format makes about as much sense as saying XML has a
by nicpottier 17y ago
They have a text format if someone chooses to share it with you. Saying that protocol buffers have a text format makes about as much sense as saying XML has a binary format. Both are true, but it misses the point.
You can get pedantic about needing a spec for everything, but the web isn't really built that way. Do you really track down the full docs for every API you interact with? Say you are just pulling down some information from tumblr via their API or the like? Probably not.. you just throw it in a browser a few times, pull out the fields you need and get on with it. XML lets you do that, quickly and easily and most of the time will work just fine forever more. XML is great for the same reasons HTML is great. It is fast and loose and lets you so easily introspect APIs that you can get your work done quickly.
- haberman 17y agoThere are times when the text format for protocol buffers can be very useful. For example, you could use the text version during development if you wanted human-readability. If I was pulling some information from Tumblr, I would at least read the introductory API docs at http://www.tumblr.com/docs/api http://www.tumblr.com/docs/api (if you didn't do that, how would you even know what URL to hit?). If they were using Protocol Buffers, they would publish their .proto file on that page. In fact that page reads very much like an informally-specified .proto file; it contains a list of all the parameters and what they all mean.