Protobuf naming conventions

I don't agree with answer 4. In the linked article I can find only examples like this:

repeated PhoneNumber phones = 4;
repeated Person people = 1;

And even in https://developers.google.com/protocol-buffers/docs/proto3 we only find plurals:

repeated Result results = 1;
repeated string snippets = 3;

Disclaimer: answer from a Googler using protobufs on a daily basis. I'm by no means representing Google in any way.

  1. Don't do that. Compiled protocol buffers are just a class definition specified by the language you are using, with some improvements. Adding "Message" is extra verbosity. Normally you just use protocol buffers without other class definitions, and even if you use other class definitions, just import java_outer_classname and do a dot from that. You can even put full path of a thing in code to erase one line of import, no problem.

  2. Although not specified officially, it sounds like a good suggestion, because normally you put more than one proto inside a folder.

  3. You normally start with 0. See the protocol buffer language guide.

  4. Yes. Read the following to get some feeling using it: https://developers.google.com/protocol-buffers/docs/javatutorial