Hey, When reading https://developers.google.com/protocol-buffers/docs/proto#simple I see a stark warning indicating that "Required is Forever" advocating the use of optional with additional application level validation routines. This is because if at some point a required field is no longer written, the readers will break.
However IMO, there are common cases where 'required' is a good thing - given that it's enforced only during encoding/decoding. For example there may be some field that is 'required' (right now) to both the reader and writer. Even if that changes at some point in the future to become optional, the reader would likely have to be updated regardless of the protocol decoding routine as it may make assumptions (reasonable considering it was required in the first place) on the presence of the field (e.g. the field being a key to a certain bit of data). In this case the approach would be to update the .proto of all readers to make that field optional, followed by updating all writers to remove the field. Given this, I feel that the current language of the linked document gives the impression that the 'required' attribute is a Bad Thing and should be avoided. I hope you can clarify if I'm missing some crucial bit of information regarding it's usage. Thanks Colin -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/protobuf. For more options, visit https://groups.google.com/d/optout.
