3 ms·
While arbitrary, that restriction would be fine if it were part of the language definition, and enforced by the Protobuf compiler. (I say "arbitrary" because "
by colanderman 7y ago
While arbitrary, that restriction would be fine if it were part of the language definition, and enforced by the Protobuf compiler.
(I say "arbitrary" because "has_" is just the nomenclature the C++ bindings happen to use. The syntactic peculiarities of other host languages may dictate a different prefix. Which then forces the question of whether to amend the list of "prohibited" field names, and potentially break existing code.)
Regardless, the restriction you propose is not currently (to my knowledge) part of the language, so you can get into the situation where you've been developing with Protobufs in Python for years, and then decide to add some C++ code, and everything breaks because now you have naming clashes which force you to rename the field and go through and edit all the existing use sites of said field.