Skip to main content

One advantage of using final / const wherever possible is that it reduces the mental load for readers of your code.

Readers can be rest assured, that the value / reference is never altered later on. So developers need not pay attention to modifications in order to understand the computation.

I've have changed my mind regarding this after learning pure-functional programming languages. It's a relief knowing you can trust that a "variable" always holds its initial value.