Why do protobuf message fields start at 1 but enum fields start at 0?
- User
Why do protobuf message fields start at 1 but enum fields start at 0?
Assistant
Protobuf Field Numbering Conventions
The difference in starting values between message fields and enum values in Protocol Buffers reflects their different purposes and implementation considerations:
Message Fields (Start at 1)
Message fields start at 1 primarily for technical and historical reasons:
-
Reserved Zero Value: Field numbers 1-15 use only a single byte for encoding (making them more efficient), and Protocol Buffers reserves the value 0 in the encoding format for internal use.
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.