D is dead
Walter Bright
newshound2 at digitalmars.com
Thu Aug 23 21:31:41 UTC 2018
On 8/23/2018 9:19 AM, Jonathan M Davis wrote:
> D was designed to have RAII, and it does. It's just that the implementation
> is buggy (which is obviously a serious problem), so depending on what your
> program is doing, it's not going to work correctly. It's not like we opted
> to not have RAII in D, and I'm sure that it will be fixed at some point. So,
> while it can certainly be argued that we've dropped the ball by not getting
> it fully fixed by now, I don't really see how it could be termed a missed
> opportunity.
As far as I know, the only known bug in RAII is
https://issues.dlang.org/show_bug.cgi?id=14246 where constructors are not
properly unwinding partially constructed objects.
My personal opinion is that constructors that throw are an execrable programming
practice, and I've wanted to ban them. (Andrei, while sympathetic to the idea,
felt that too many people relied on it.) I won't allow throwing constructors in
dmd or any software I have authority over.
(Having throwing destructors is even worse, it's just madness. Although it is
allowed in C++, it doesn't actually work.)
My personal opinion aside, it is a feature in D, and should work correctly, and
is a serious issue for those that use throwing constructors. (It's not a
disaster, though, as scope(failure) can be used to work around it.)
More information about the Digitalmars-d
mailing list