Do we really need const?

Don Clugston dac at nospam.com.au
Mon Sep 17 00:46:35 PDT 2007


Bill Baxter wrote:
> It seems from the discussion here the past week, there is no real 
> multithreading benefit to be had from const/invariant.  'Pure' is where 
> it's at for that.  So maybe we're just better off without the 
> complexities of const.

I'm thinking the same way. There are clear benefits to 'pure', with both 
multi-threading and optimisation, and it's conceptually simple and easy to 
explain to a newbie. But 'const' seems to be a horrible morass, complicated to 
explain, complicated to code, and with very little benefit.

At the very least, it's clear that 'const' has cost the D community a huge 
amount of discussion bandwidth and mental space, with very little of use to show 
for it. We may be caught in a productivity trap.



More information about the Digitalmars-d mailing list