Why is `scope` planned for deprecation?

Manu via Digitalmars-d digitalmars-d at puremagic.com
Thu Nov 13 03:44:20 PST 2014


On 13 November 2014 20:38, via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
> On Thursday, 13 November 2014 at 10:24:44 UTC, Marc Schütz wrote:
>
> D need to appropriate what C++ has and do it better. Basically it means
> integrating GC pointers with unique_ptr and shared_ptr.
>
> If D is going to be stuck on what it has and "fix" it with addig crutches it
> will go nowhere, and C++ will start to look like a better option…

I don't follow how you associate that opinion with implementation of
scope. I think it's practical and important, and the point is the
opposite of what you say from my perspective.
scope is the best approach I've heard to address these differences in
allocation patterns without asserting any particular policy on the
user. Escape analysis is the only solution I know to safely allow
pointers to be passed around without having to worry about how they
were allocated.
By contrast, I have no idea what you're suggesting, or how it's not a
'crutch'... but if it's anything to do with C++, I'm dubious, and
kinda frightened.


Incidentally, I've recently started a new C++ job, first C++ I've
written in some years... (after ~18 years, 12 professionally,
full-time C/C++)
After having adapted to D and distancing from C++, trying to go back
is like some form of inhuman torture!
I really don't remember it being as bad as it is... the time away has
given me new perspective on how terrible C++ is, and I can say with
confidence, there is NOTHING C++ could do to make itself a 'better
option' at this point.
Judged on common ground, there is no competition. It's only 'the devil
you know' case that I think can possibly make an argument for C++.



More information about the Digitalmars-d mailing list