Google Can Have Stupid Ideas, Too
Case in point: Protocol Buffers:
Protocol buffers are a flexible, efficient, automated mechanism for serializing structured data – think XML, but smaller, faster, and simpler. You define how you want your data to be structured once, then you can use special generated source code to easily write and read your structured data to and from a variety of data streams and using a variety of languages. You can even update your data structure without breaking deployed programs that are compiled against the “old” format.
In-depth analysis from Ted Neward here.
Stefan, Since you seem to believe that Protocol Buffers are “stupid” I’d appreciate it if you could indicate what you feel is wrong with them?
You know, the history of CS is reinventing itself… so why Google wouldn’t want to reinvent the data description mechanisms?
I also think XML (or YAML, if you want) is actually a better choice, but you know, they introduced that Google Apps thing, that uses a similar scheme to describe the data being managed by any G-app, so I guess this kind of compatibility is what they want.
Regards, diego.
I don’t think protocol buffers is dumb. I think positioning it as an alternative to XML was pretty dumb.
You are right, I was a bit too quick with my post. I’ve not done any in-depth analysis of Protocol Buffers to say whether in its domain it’s better or worse than alternatives such as RPC, CORBA, ASN.1, or BEEP; at best, it strikes me as an unnecessary re-invention (but I may be wrong). Positioning a format with out-of-band compiled contracts (i.e. shared code, not schema, in Don Box’s words) as an alternative to XML is what I consider stupid.
PB is great stuff; like most things its what you do with it thats smart or dumb :). If you are building a web application, you’ll probably stick with XML or JSON but if you are building stuff inside the firewall its a great self describing binary message format when you want a performance boost.
XML doesn’t have performance issues per se… the peformance issues belong to XML parsers..