> On 1/08/11 7:29 PM, Kagamin wrote:
> > Walter Bright Wrote:
> >> Now on reddit!
> >> 
> >> http://www.reddit.com/r/programming/comments/j48tf/how_is_c_better_than_
> >> d/
> > 
> > C++ has a better thought out type system.
> > Nice joke.
> > http://blog.llvm.org/2011/05/c-at-google-here-be-dragons.html
> > 
> > Please read my note at the end. I believe D (probably) has a better type
> > system. It just wasn't very well though out.
> > 
> > I believe many aspects of D's type system were added in without fully
> > exploring the ramifications they had on other parts of the language.
> > There are at least two pieces of evidence which support my belief:
> > 
> > 1. The fact that you can't copy const struct objects containing
> > reference types.
> 
> You can copy them, but not to mutable. In exchange, you get transitive
> const.
> 
> > 2. The fact that the root object still isn't const correct.
> 
> I think it could be. It would just force everyone implementing opEquals to
> be const correct too. Or is there any other fundamental issue?

The primary issues are actually doing the work to make it const-correct and 
the fact that if the compiler's handling of const is buggy, it could really 
screw over Object - and thus all classes. So, the bug has sat there for a long 
time. I'm not sure that there are really any issues with it at this point 
other than taking the time to do it though.

> > C++ has some questionable choices for its type system, but it generally
> > doesn't prevent you from getting work done.
> 
> I have not yet been affected by any of your two issues. Do you have example
> use cases where they prevent you from getting work done?

You lose logical const, which he has wanted to use in stuff that he's been 
doing (games I think). He wants to lazy load values in his objects. You can't 
do that with D's const. It pretty much means that that you have to either 
eager load it or give up on const. It's totally doable, but it forces you to 
change your design in a manner which you might not like.

- Jonathan M Davis

Reply via email to