Skip to content
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

Add section to coding guidelines on Optional usage #6894

Merged
merged 4 commits into from
Oct 23, 2022
Merged

Add section to coding guidelines on Optional usage #6894

merged 4 commits into from
Oct 23, 2022

Conversation

trask
Copy link
Member

@trask trask commented Oct 17, 2022

This was discussed a long while back, but never documented (and recently came up in #6889)

@trask trask requested a review from a team October 17, 2022 21:02
@github-actions github-actions bot requested a review from theletterf October 17, 2022 21:02
Copy link
Member

@theletterf theletterf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with a couple suggestions.

Comment on lines +135 to +136
It is ok to use `Optional` in places where it does not leak into public API signatures and where
performance is not critical.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
It is ok to use `Optional` in places where it does not leak into public API signatures and where
performance is not critical.
Use `Optional` where it does not leak into public API signatures and where
performance is not a critical aspect.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe It is acceptable to use? we don't exactly want to "recommend" it, only mention that it is "ok" (i.e. author's choice to use or not)

docs/contributing/style-guideline.md Outdated Show resolved Hide resolved
@trask trask merged commit d18a05b into open-telemetry:main Oct 23, 2022
@trask trask deleted the optional-vs-nullable branch October 23, 2022 01:07
LironKS pushed a commit to helios/opentelemetry-java-instrumentation that referenced this pull request Oct 31, 2022
This was discussed a long while back, but never documented (and recently
came up in open-telemetry#6889)

Co-authored-by: Fabrizio Ferri-Benedetti <[email protected]>
LironKS pushed a commit to helios/opentelemetry-java-instrumentation that referenced this pull request Dec 4, 2022
This was discussed a long while back, but never documented (and recently
came up in open-telemetry#6889)

Co-authored-by: Fabrizio Ferri-Benedetti <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants