Interestingly scala makes the choice fairly explicit - val or var - your choice. In practice I find I default to using val - as I know when I debug I only have one place to look for where the value is, and there is generally less cursing when a value mysteriously changes (it doesn't).
(Java has final, and C# has 'const' which is kinda similar).
Although in their case you have to choose extra verbosity, but its often worth it.
(Java has final, and C# has 'const' which is kinda similar). Although in their case you have to choose extra verbosity, but its often worth it.