Skip to content

Document our practices around using auto and naming variable types #5663

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

Merged
merged 3 commits into from
Jun 18, 2025

Conversation

danakj
Copy link
Contributor

@danakj danakj commented Jun 13, 2025

We use auto for most local variables, and we put the type name into the variable name in common cases, especially for our ID types.

This was discussed in #style: https://discord.com/channels/655572317891461132/821113559755784242/1380091326900469801

@github-actions github-actions bot requested a review from josh11b June 13, 2025 14:17
@danakj danakj added the documentation An issue or proposed change to our documentation label Jun 13, 2025
@danakj danakj requested a review from jonmeow June 13, 2025 17:27
Copy link
Contributor

@jonmeow jonmeow left a comment

Choose a reason for hiding this comment

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

I think LG from my perspective, though may want to get another pair of eyes on it.

@danakj danakj added this pull request to the merge queue Jun 18, 2025
@danakj
Copy link
Contributor Author

danakj commented Jun 18, 2025

There was some discussion on discord (in #style) about if this should be a proposal (we concluded no), and no further comments on the text here were raised, so merging as-is.

Merged via the queue into carbon-language:trunk with commit 4a96799 Jun 18, 2025
8 checks passed
@danakj danakj deleted the style-auto branch June 18, 2025 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation An issue or proposed change to our documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants