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

Discuss and unify the use of const keyword for local variables #215

Open
fakedev9999 opened this issue Jan 5, 2024 · 0 comments
Open

Discuss and unify the use of const keyword for local variables #215

fakedev9999 opened this issue Jan 5, 2024 · 0 comments
Assignees
Labels
refac Refactor for better quality code

Comments

@fakedev9999
Copy link
Contributor

As written in Google C++ Style Guide: Use of const, indicating the variables that are not changed with const keyword makes easier for people to understand how the variable is used, along with the complier to do better type checking, assuring better code.

So, as in suggestion of this comment, seems reasonable.

However, through out our repository, the use of const keyword for local variables is not organized well. Plus, in the decision section of the Google C++ Style Guide: Use of const, it says

Using const on local variables is neither encouraged nor discouraged.

It's quite trivial, but I thought it would be great to at least have a discussion on this point and have a policy with regards to this throughout our repository.

@fakedev9999 fakedev9999 added the refac Refactor for better quality code label Jan 5, 2024
@fakedev9999 fakedev9999 self-assigned this Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refac Refactor for better quality code
Projects
None yet
Development

No branches or pull requests

1 participant