Unofficial wish list status.(Jul 2008)

Walter Bright newshound1 at digitalmars.com
Tue Jul 22 17:46:18 PDT 2008


Bill Baxter wrote:
> By that do you mean something that's caused you actual trouble in C++
> projects?  Or just something that keeps you awake at night worrying
> about the trouble it could cause?  My feeling is that C++ const does a
> decent job in practice of preventing programmers from doing stupid
> things.  On the other hand, if you're trying to go out of your way to
> be stupid... that's another matter.  But for the most part, while it
> may be easy to circumvent const, it's not so easy to circumvent it
> accidentally.  Useless for making compiler optimizations, yes, but
> fine for documenting the intent of code.

It isn't that unusual for C++ programmers to rely on having a const 
pointer to mutable data (I know this because they tell me that their 
design breaks with D). C++ has no self-documenting method to distinguish 
transitive const from non-transitive const, yet both are used in real code.

C++ const has also turned out to be of no value for writing 
multithreaded code. C++ const was fine for the 90's, but those days are 
over. C++0x has not addressed this issue, as the C++ community has not 
yet recognized the problem (many individual top C++ programmers do 
recognize it, but I've gotten the impression they see it as unimportant 
or hope it will just go away). I expect that it will become glaringly 
obvious over the next few years. The coming multicore revolution is 
going to cause big problems and the proposed C++0x threading model isn't 
going to fix it.



More information about the Digitalmars-d mailing list