Oy vey! The example made me cringe. The author is reindexing the fields of a protocol buffer! That is a terrible idea.
Yep, we decided to allow support for a major v2 of our protos, with new namespaces, new semantics, actual composition rather than hundreds of duplicated fields. As such I was changing a lot of protos and renumbering them to not have empty numbers, then alphabetizing them for ease of reading.
What did you think of the other examples?
I liked pulling an interface out of a class.
I can imagine it making some sense for a small project which has a relatively easy time managing compatibility constraints. When I first started using protocol buffers, I was already strongly of the belief that there needed to be something like them. (It was very “confound those who have had our ideas before us”, although I was happy about it too. :)) Despite having put a lot of thought into my ideal self-describing data format, the issue with needing to maintain compatibility while evolving the structure in production environments had simply never occurred to me. The scale things are running at makes a big difference in what the constraints are.