[Issue 11949] Warning and later deprecation message for usage of delete

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jan 20 01:09:10 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=11949


Maxim Fomin <maxim at maxim-fomin.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |maxim at maxim-fomin.ru


--- Comment #4 from Maxim Fomin <maxim at maxim-fomin.ru> 2014-01-20 01:08:58 PST ---
(In reply to comment #2)
> I'm with bearophile on this. If something goes away, let it go away. I may not
> be an active member of D community, but I am interested in writing software in
> D. This "ought to be deprecated but isn't, and what's the replacement?.." thing

Rest nonsense is skipped. Do you now that removing delete actually hurts
programming? I am fine that you are interested in writing D code, but asking to
remove necessary feature which may be used by other people is bad idea.

Delete is actually needed because without it memory management really gets
hurt. Without delete and especially overriding new and delete operator methods
there is no way to allocate memory for classes in user-friendly way. One need
to use old malloc/free or whatever function to allocate mem in specified place.
Why should this be done if there is already syntax and semantic for this? If
delete and respective class methods are removed, this will increase problem of
optional GC.

In my view removing delete is like removing scope(XXX) because same effects can
be achieved by try-catch-finally blocks. In addition, multiple replacements -
destroy, clear and whatever it is, not only do not address the problems, but
are crippled. Removing delete belongs to the same basket as removing typedef: a
good feature is removed without any valid reasons some years ago and there are
still complains that replacement (Typedef struct) does not work. 

Besides being useful, there is _zero_ real arguments against delete except
Andrei's (who is essentially saying that delete contradicts his subjective
views about nice and good code - I tried to figure some grounds and failed, he
essentially repeats like in case of typedef that the feature is 'bad').

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list