From feedback I have received in the past, I have been trying to move away from having 'magic' values in my code. I tried doing this too with expressions as well. Below is an example function where I replaced return values by const variables, and expressions by const variables.
Is this acceptable or am I going too far with this? I find that this particular trial example came out to be much easier to read than before. (Typically I define global or namespace constants with the same capitalization scheme shown for these const variables, so I may change naming conventions to avoid collisions with the namespace.)
Lines 16~27 are "easier to read", but all the above seems a bit messy to me. But I'm guessing those declarations generally won't be inside the function?