Another Transitive const solution
Alex Burton
alexibu at mac.com
Fri Apr 11 01:14:28 PDT 2008
Georg Wrede Wrote:
> Hans W. Uhlig wrote:
> > Jarrett Billingsley wrote:
> >
> >> "Alex Burton" <alexibu at mac.com> wrote in message
> >> news:ftjfrg$24lu$1 at digitalmars.com...
> >>
> >>> Jarrett Billingsley Wrote:
> >>>
> >>>> "Alex Burton" <alexibu at mac.com> wrote in message
> >>>> news:fti5dd$8h7$1 at digitalmars.com...
> >>>>
> >>>>> I wonder how many lurkers like me are waiting for D 2.0s const
> >>>>> system to be
> >>>>> sorted out so that we can start using it.
> >>>>> Experience shows that const is viral and you are either using it or
> >>>>> not
> >>>>> using it, and if libraries are using it, then you have to use it or
> >>>>> you
> >>>>> can't use the libraries.
> >>>>> So I am not going to write a bunch of D 1.0 code until D 2.0's
> >>>>> transitive
> >>>>> const is fixed.
> >>>>
> >>>> What? What does constness in D2 have anything to do with D1?
> >>>>
> >>> Knowing that fundamental changes to the language will come in the
> >>> next version makes me hesitant to start writing lots of code in D1.
> >>>
> >>
> >> The entire reason for making D1 _D1_ was so that people _would_ start
> >> using it. It strikes me as very odd that the exact opposite seems to
> >> have happened. You're not the only one to come to this decision.
> >>
> >> Personally I won't even consider D2 until it's frozen. Furthermore
> >> just because you write code in D1 doesn't mean you'll _have_ to start
> >> using D2.
> >>
> >
> > I think this idea comes out of the same mindset as Java. You don't want
> > to use something you know is going to be deprecated so soon down the
> > road. Since D2.0 is an evolution of the product rather then a new
> > language it is seen as the next version, why write something that wont
> > work with the next version when you can write it for that version. I
> > think its simply the fact that D2 isn't backwards compatible for a good
> > chunk of things. Porting might end up being a bigger pain then simply
> > waiting is.
> >
> > I look forward to a lot of the changes in parallel processing and
> > library support coming for D2 and am waiting to start a few projects
> > until D2.0s feature set is frozen, till then I merely putter.
>
> But nobody knows when that'll happen!
>
> It might be months, but it might as well be late /next/ year.
>
> And if you do regular (as in just normal) programmin in D1, chances that
> you'd have to work hard to later port it to D2 are small. Most of the
> things in D1 aren't going to change anyway. There'll mostly be just more
> things to the language.
>
> Of course, some people don't buy a new cellular phone because next year
> you get a twice cooler one for half the price. Or they don't buy a new
> computer "because they're getting cheaper and stronger all the time, so
> for every month I push back buying one, I actually earn money".
>
> You might as well skip waiting alltogether, because (as with any
> programming language) the day /will/ come when D is obsolete.
>
> But then you shouldn't marry either, because one day she'll either
> divorce you or die.
>
> In reality, you might get a lot of things done in D1 while waiting, and
> possibly even enjoy both the programming, and the results of it.
I know what you mean - you can't put off buying a computer till the next version comes out because there will always be a better one coming out.
But this is different, I think that the const system in D will either make it or break it.
Make it as in confirm it as a complete mature, state of the art language that is a serious option,
or break it as in the D community fragments into those unwilling to use the const system and stay on D 1 and those who are happy with the const system.
I am itching to start working in D instead of C++ (because of the hundreds of reasons that D is better than C++), but I want to reduce the risk that I migrate into a language that doesn't have a future. For me the successful implementation of const is when I think D will have no further problems.
At the moment I am just lurking on this list and occasionally trying to suggest reasonable alternatives to the current transitive const system which I think is unworkable and not of any benefit.
I actually use transitive const in C++ (implemented using smart pointers) but it is an opt in system, so that I can document and have the compiler check constness.
Alex
More information about the Digitalmars-d
mailing list