Why is `scope` planned for deprecation?

Paulo Pinto via Digitalmars-d digitalmars-d at puremagic.com
Thu Nov 13 03:53:38 PST 2014


On Thursday, 13 November 2014 at 11:44:31 UTC, Manu via 
Digitalmars-d wrote:
> 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++.

C++14 is quite nice and C++17 will be even better.

Then there is the advantage it is available in all OS vendors 
SDKs, with very nice tooling.

However, the hard reality in most corporations is that code bases 
will be pre-C++98 with its own set of guidelines, if any.


--
Paulo


More information about the Digitalmars-d mailing list