rebind of const class variables

ketmar via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jan 20 07:05:00 PST 2015


On Tue, 20 Jan 2015 14:45:26 +0000
bearophile via Digitalmars-d-learn <digitalmars-d-learn at puremagic.com>
wrote:

> ketmar:
> 
> > Jonathan explains it very well. i can add the only thing: don't 
> > use `const` until you forced to. ;-)
> 
> In D use immutable (or const) everywhere you can. Possibly mark 
> as immutable everything doesn't need to mutate.
i didn't tell a word about `immutable`. ;-)

but `const` transitiveness confusing newcomers alot. eventually they
will catch it and then they will see how my advice is not applicable to
'em anymore. but until then i believe that they better don't use
`const` at all instead of becoming constantly frustrated with it's
"non-friendly" behavior.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20150120/611e4ab0/attachment.sig>


More information about the Digitalmars-d-learn mailing list