Code readability

I am spending lots of time these days reading cycles code, and I think, the learning curve is a bit steeper than it could be. I caught myself adding consts, and modifying class declarations by moving data members to private to figure out if they are modified from the outside. So I think const-correct code, and more private fields in classes would help code readability by reducing the mental load on the reader.

Of course nobody wants to rewrite existing code this way. But would patches be accepted that deviate from the given file’s coding style in this regard?


If you can make stuff const, then you should. From the code style guide:

Use const whenever possible. Try to write your code so that const can be used, i.e. prefer declaring new variables instead of mutating existing ones.

This sounds like a great project for Code Quality day.


Adding more const where appropriate is welcome.

1 Like