Do we need a time-out in D evolution?

Regan Heath regan at netmail.co.nz
Fri Jun 8 10:22:56 PDT 2007


eao197 Wrote:
> On Fri, 08 Jun 2007 20:22:09 +0400, Carlos Santander  
> <csantander619 at gmail.com> wrote:
> 
> > I might be wrong, but I don't think Dv2 will be incompatible with Dv1 in  
> > a major way. If you start coding now, perhaps you'll have to branch your  
> > code to make use of the shiny new features of Dv2, but I don't foresee  
> > many changes. Of course, I guess that depends on your actual code and  
> > the features you want to use, but I still wouldn't be so worried.
> 
> I don't agree with you. As a C++ programmer I'm big fun of 'const' -- it  
> have saved me from bugs several times. So when const became a part of D I  
> certaintly rewrite my code with use of const/final/invariant. To show you  
> how it can affect my project I can say -- in one my rather big C++ library  
> (~46K lines) there are 121 *.hpp files with ~280 const methods and ~900  
> const parameters. I think it is not too easy to write all that staff  
> without const at first and then carefully rewrite and retest it with const.

Another reason for const by default with implicit 'in'.  If this was implemented then you wouldn't need to re-write anything to get the full benefit where function parameters are concerned.  You would need to add const to return values and method signatures, but that would be a lot less to add/recode.

Regan



More information about the Digitalmars-d mailing list