Some people use const with every variable that is not meant to change, for the simple reason that it might reduce chance of bugs is complicated code due to dev error. Read More
15. Use const proactively.
const is your friend. Immutable values are easier to understand, track, and reason about, so prefer constants over variables wherever it is sensible and make const your default choice when you define a value. It's safe, it's checked at compile time,
and it's integrated with … Read More
I believe so, once you get into a mindset of using const keyword like that it just becomes natural no matter how non or complex the method is.
It's a really good mindset I think, especially if you're coding in C or C++ with all those pointers knocking around. Read More
Lots of good answers here! In this particular example, const is not required, but may, as indicated by others, allow the compiler to utilize some optimizations which may (or may not) help performance. Read More
@vijayan121 I just wanted to let you know about this other online compiler with assembly view: http://goo.gl/64kMZO Read More