On Thursday, 8 October 2015 at 14:13:30 UTC, Jonathan M Davis
wrote:
I've programmed extensively in C++ with smart pointers, and in
my experience, circular references are rarely a problem. There
are some cases where it's obvious that you have one (e.g. where
one object owns another and they need to talk to each other),
in which case you either use a normal pointer or a weak
reference, depending on which makes more sense. And in the
cases that you don't catch, you find them in testing, figure
out what should be a weak reference to get rid of the circular
dependency, you fix it, and you move on. It really isn't a big
deal in general, though I suppose that there could be certain
ways of designing programs where it would be more problematic.
That's all understandable. What's not understandable is when one
insists that a necessity to figure out ownership for every
non-resource object in C++ is superior to D.