3 ms·
> 3. Protobuf's notions of required vs optional fields was a design mistake that's now impossible to rectify without breaking changes. Can you elaborate on thi
by matt_kantor 6y ago
> 3. Protobuf's notions of required vs optional fields was a design mistake that's now impossible to rectify without breaking changes.
Can you elaborate on this?
I've barely used protobufs, but in thrift I've found optional fields to be very useful.
- ochoseis 6y agoI think you're on the same page. The gist is that while you'd hope to have a stable interface, in reality things change. By marking fields required, they basically have to stay that way forever so you can support older clients. In doing so, you create a brittle API that may not be able to evolve with changing requirements. For this reason, I believe Google got rid of required fields in proto3 (everything's either implicitly optional, or a repeated field which may have 0 elements).
- matt_kantor 6y agoAh! I read your comment as "optional was a mistake", not "required was a mistake". We are indeed on the same page.