const sucks

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sat Oct 18 14:35:48 PDT 2008


John Reimer wrote:
> Are there any other drawbacks with default immutability other than 
> breaking with the norm?

Well for one thing much of OO style involves creating few objects that 
hold their state and evolve in well-defined ways. Many objects are
"entity" objects, meaning that holding a reference to a particular 
object is the way to stay in touch. In FP style new objects are being 
created all the time, so the programming styles are very different.

But by and large I find it very interesting that the tide has changed to 
the extent that this option is being discussed. It's good progress from 
the const-should-die-a-gruesome-death view :o).


Andrei



More information about the Digitalmars-d mailing list