Open machinekoder opened 8 years ago
Another good tip from the thrift guide:
Non-required fields can be removed, as long as the tag number is not used again in your
updated message type (it may be better to rename the field instead, perhaps adding the prefix
"OBSOLETE_", so that future users of your .thrift can’t accidentally reuse the number).
Protobuf3 removes the option to set default values instead type specific values are used.
@machinekoder Is a move to proto3 in the works? The new language support (c#, go, etc.) is only available in proto3+. Plus, they promise not to change the API as fluidly as before. nanopb has supported proto3 since 0.3.7, but I don't think Jessie is supporting it. Would probably need to make a package like czmq. Pretty sure stretch is already supporting proto3 with the default packages.
@dkhughes You can already compile Machinekit with Protobuf 3.x.
Regarding default values, I have no idea what Protobuf 3.x does with proto2 files when it comes to default values.
I meant proto3 syntax in the proto files. Protoc will not generate code for proto2 files in some of the newer languages.
It is good design practice to make all fields optional. It is not only recommended with Protocol Buffers but also Apache Thrift which has similar IDL language:
See: http://diwakergupta.github.io/thrift-missing-guide/thrift.pdf
With Protobuf 3 there only will be optional fields as a result of feedback to the problem.