News for hackers. Stuff that matters.
Re:Modern garbage collection: Part 2 by LessDmesg on Sunday December 15, 2019 @03:30AM (#21795155)
Interesting. Could you give an example of such a memory lifetime bug in C# and why C++ is impervious to it?
Re:Modern garbage collection: Part 2 by nwallin on Monday December 16, 2019 @10:18PM (#21810206)
async factory methods for stuff the API requires me to keep around, but the same API requires my objects to be constructed synchronously. (This includes stuff in .NET) C++ doesn't have async as a language construct. (yet. I dread the day.)

IDispose. We have an ecosystem where a nonnegligible number of in flight objects need to manually be disposed of. In C++, RAII takes care of this for us.

Un listening to events. Needs to happen manually in the standard .NET listeners. C++ solves this with weak_ptr. C# could solve this with a better standard library, but we have .NET.

Honorable mention (not lifetime, but the deadlock quagmire that is C# and its half async half synchronous standard library) is WritableBitmap, which is impossible to use correctly, and has not been deprecated or had a safe replacement offered.

C++ surprises me in ways I expect to be surprised. C# surprises me in ways that leaves me confused and perplexed.