[protobuf] Re: Can I add a new item into an existing list of enumerations safely?

2010-05-14 Thread john mani
Thanks. To make this generic and allow for multiple commands to be added in future, would a good strategy be to define: enum Type { POP = 0, PUSH = 1, UNKNOWN = 100 }, and later add TOP, TAIL, etc. etc. as items after PUSH (meaning with values 2, 3 ... ). So, later we have: enum Type { POP =

Re: [protobuf] Re: Can I add a new item into an existing list of enumerations safely?

2010-05-14 Thread Jason Hsueh
It doesn't matter that much. I only set UNKNOWN = 2 on the assumption that pop and push were already assigned and you needed to preserve wire compatibility. If I were starting from scratch I would probably define UNKNOWN as the first value and set it to 0. Making it the first value defined makes