Skip to content

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

@fakedev9999

Description

@fakedev9999

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.

Metadata

Metadata

Assignees

Labels

refacRefactor for better quality code

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions