-
Notifications
You must be signed in to change notification settings - Fork 560
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
Changing API style guide not to use acronyms #364
Comments
wora
changed the title
Changing style guide not to use acronyms
Changing API style guide not to use acronyms
Feb 8, 2018
wora
added a commit
to wora/api
that referenced
this issue
Feb 9, 2018
Update guideline not to use acronyms in API definition. Fixed istio#364.
Merged
geeknoid
pushed a commit
that referenced
this issue
Feb 9, 2018
Update guideline not to use acronyms in API definition. Fixed #364.
ayj
pushed a commit
to ayj/api
that referenced
this issue
Feb 14, 2018
Update guideline not to use acronyms in API definition. Fixed istio#364.
incfly
pushed a commit
to incfly/api
that referenced
this issue
Jun 13, 2018
nacx
added a commit
to nacx/api
that referenced
this issue
Feb 23, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using acronyms in API definition has been a very debatable issue, such as
HTTPRequest
vsHttpRequest
, and different programming language made different choice. For Istio, two heavily used languages, Go and proto3, made different choice.Go: https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#naming-conventions
Acronyms should similarly only be used when extremely commonly known. All letters in the acronym should have the same case, using the appropriate case for the situation. For example, at the beginning of a field name, the acronym should be all lowercase, such as "httpGet". Where used as a constant, all letters should be uppercase, such as "TCP" or "UDP".
proto3 style strictly use camel case for type names, no acronym is allowed.
One important issue is proto3 field names are using lower_underscore_case. When field names are used in JSON, they are mechanically converted to lowerCamelCase, so acronyms are not possible.
Given the above differences and all Istio APIs are written in proto3, I recommend Istio should use CamelCase without acronyms. This would be consistent with Envoy, proto3, gRPC. Currently, only HTTP, TLS, TCP and a few acronyms are used, so this would not be a major change.
@rshriram I think this proposal would mainly impact your work. Other places should be fine. In the long term, aligning all proto3 APIs is more valuable than aligning proto3 with Go. Thanks.
The text was updated successfully, but these errors were encountered: