D and Nim

bearophile via Digitalmars-d digitalmars-d at puremagic.com
Sun Jan 4 19:56:30 PST 2015


Ary Borenszweig:

>> D programmers should apply const/immutable to every variable 
>> that
>> doesn't need to mutate.
>
> Why?

Since some years Computer Science has found that the right
default for variables is to have them immutable, and to have them
mutable on request.

Immutable variables make the code simpler to understand for
programmers and more handy for compilers. The less moving parts
your code has, the better it's for you.

More explanations on request.

Bye,
bearophile


More information about the Digitalmars-d mailing list