Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I work at an indie game shop and I have pushed us to use it (almost) everywhere we need to define a file format. Originally we were using JSON for everything, which is great for the quick and dirty approach -- but as our code base (primarily C++) has grown I absolutely love the guarantees I get with protobufs:

- Strongly typed, no boilerplate error checking if someone set my "foo" field on my object to an integer instead of a string

- Easy to version and upgrade, just create new fields, deprecate the old ones, and move on with life.

- Protobuf IDLs are the documentation and implementation of my file format -- no docs to write about what fields belong in what object and no issues with out of sync documentation/code.

- Reflection support, don't use this a lot, but when I need it it's awesome.

- Variety of storage options. For instance the level editor I wrote recently uses the human-readable text format when it saves out levels. But when I am ready to ship, I can trivially convert these level files to binary and immediately improve the performance of my app.

- Tons of language bindings. Our engine code base is C++, but any build scripts I write are done in Python and if my script needs to touch protobuf files I don't have to rewrite my file parsing routines -- it just works.

I looked into using Apache Thrift as well, but their text-based format is not human readable so it was a non-starter for us.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: