-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make all fields optional and set sensibe default values #53
Comments
Another good tip from the thrift guide:
|
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.
The text was updated successfully, but these errors were encountered: