32 ms·
> RAII, smart pointers and ARC aren't free lunches, which is why people had moved from them to GC in the first place. Yet GC solves 10% of the problem that RAI
by waps 12y ago
> RAII, smart pointers and ARC aren't free lunches, which is why people had moved from them to GC in the first place.
Yet GC solves 10% of the problem that RAII solves. Tbh I would call them "similar". GC has the advantage of being much more tolerant of sloppy programming, but if you compare the complexity of GC with the complexity of RAII, I'd say RAII has a clear advantage.
- pjmlp 12y agoMost RAII use cases can be taken with using/with/try/lambdas