Thoughts from newcommer

Shachar Shemesh via Digitalmars-d digitalmars-d at puremagic.com
Sun Apr 16 00:50:43 PDT 2017


On 11/04/17 23:09, Jack Stouffer wrote:
> On Tuesday, 11 April 2017 at 19:57:19 UTC, Piotr Kowalski wrote:
>> What about RAII?
>
> It's already in the language.
>

There are two problems with that statement.

The first is that the language does not offer any RAII containers out of 
the box. What it does provide is the *ability* to create RAII 
containers. D supports RAII, but does not actually have RAII.

The second, more serious, problem is that RAII requires destructors to 
run 100% reliably, and D simply doesn't have that. In that sense, the 
claim that D supports RAII is, at this point in time, a lie.

(And, yes, there is an open bug: 
https://issues.dlang.org/show_bug.cgi?id=14246)

Shachar


More information about the Digitalmars-d mailing list