3 ms·
RAII is very obviously a bad idea, and I'm shocked that more people can't see this. it's "fine" until it isn't, and when it bites you, it crushes your arm. yo
by naikrovek 5y ago
RAII is very obviously a bad idea, and I'm shocked that more people can't see this. it's "fine" until it isn't, and when it bites you, it crushes your arm. you are unlikely to ever forget this after it happens. it's like driving a car fast while blindfolded; you will crash, and it will hurt, it's just a matter of when.
- pcwalton 5y agoCare to explain why? In Rust RAII works very well, and the common failure mode of RAII--use-after-free--is statically prevented by the borrow check.
- cmrdporcupine 5y agoUse-after-free is definitely the major footgun portion of RAII in C++ (in my experience) but seems to me like the same issue would be present in any non-GC'd language that offers a 'deferral' mechanism, asynchronous or not (unless it has ownership/borrow management like Rust as you point out).
- marton78 5y agoYour claims would benefit from you substantiating them.
- naikrovek 5y agountil you experience the problems yourself, you won't believe me, anyway, no matter what evidence I provide. it is way too easy to critique an approach that led to a problem that hasn't happened to you, and is described to you by someone else.